• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 355
  • Last Modified:

Reference a Class Library from another Class Library in a Solution with 3 projects

I've downloaded the Cassini souce code and modified it.  Built the project in "release" mode.  In another solution, which contains 2 exe's and a class library, I'm referencing the Cassini dll I just built by the Class library.

Everything compiles without any errors, but as soon as I run the solution (by double clicking the EXE), I get an error that it can't load the Cassini Assembly because the file cannot be found.  I've tried cleaning the solutions and rebuilding them but still no luck.  The only way I seem to be able to get it to work is to remove my reference to my custom Cassini build and instead reference Cassini from the GAC.  

What gives?  I've referenced custom dll's a million times before and never had any issues.
0
davidcahan
Asked:
davidcahan
  • 4
  • 3
1 Solution
 
AshokCommented:
Which Class Library has a reference to other Class Library?

If ClassLibrary2 has reference, add DLL in the bin folder of ClassLibrary2.

HTH
Ashok
0
 
davidcahanAuthor Commented:
Sorry, that doesn't help. This is a client app. There isn't a bin folder. I've tried just about every obvious thing I could try
0
 
AshokCommented:
Try adding dll to the PATH (Environment Variable).

HTH
Ashok
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
AshokCommented:
You can use (dependentAssembly and codeBase) entries in
App.Config to tell the application where to look for its Dll's.

I am not sure exactly what you have to add in App.Config right now.

HTH
Ashok
0
 
AshokCommented:
Here is sample.....

      <dependentAssembly>
        <assemblyIdentity name="ConsoleDLL"
                          publicKeyToken="[token]"
                          culture="neutral"/>
        <bindingRedirect oldVersion="[oldversion]"
                         newVersion="[newversion]" />
        <codeBase version="[newversion]"  href="file:///c:\bin\ConsoleDLL.dll" />                
      </dependentAssembly>

HTH
Ashok
0
 
davidcahanAuthor Commented:
Was able to get it working.  Turns out that Cassini has to be registered in the GAC EXCEPT if you do the following:

1) reference your custom cassini.dll in your .NET project
2)build your project
3)install/move your project onto the client machine
4)copy Cassini.dll into the bin folder of your webroot

so, you have to have your cassini.dll in your client app folder and in the bin folder of your web root.  if there is no bin folder you have to create one and drop cassini into it.
0
 
davidcahanAuthor Commented:
figured it out myself
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now