Solved

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

Posted on 2010-11-14
7
326 Views
Last Modified: 2012-05-10
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
Comment
Question by:davidcahan
  • 4
  • 3
7 Comments
 
LVL 13

Expert Comment

by:Ashok
ID: 34131217
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
 

Author Comment

by:davidcahan
ID: 34142728
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
 
LVL 13

Expert Comment

by:Ashok
ID: 34144705
Try adding dll to the PATH (Environment Variable).

HTH
Ashok
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 13

Expert Comment

by:Ashok
ID: 34144949
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
 
LVL 13

Expert Comment

by:Ashok
ID: 34144993
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
 

Accepted Solution

by:
davidcahan earned 0 total points
ID: 34175334
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
 

Author Closing Comment

by:davidcahan
ID: 34203718
figured it out myself
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

932 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now