views:

1440

answers:

2

Writing a routine WinForms app that references a few custom libraries written by myself. I am building one particular library which depends on another library and, when I do, I get the following warning message:

"Could not load file or assembly 'RHLib' Version 1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified"

The application functions, there are no error messages, but I am one of those that likes a completely clean compile - no errors, no warnings. And I cannot figure this one out.

The library in question has a reference to the "missing" library, the "missing" library is compiled and lives in the Debug directory when VS finishes compiling, the build order places the "missing" library as the first item built and the "missing" library has no dependencies - its a small library built to get me out of a circular assembly problem.

Any ideas?

+2  A: 

Did you right click on the project, and click Add Reference, and then add using RHLib; to the top of the file?

lod3n
Yes, out of the Project tab as it is in the same solution.
Bruce
What dependencies does RHLib have?
lod3n
A: 

Looks like I may have found it. Even though the warning was coming from the library that used the "missing" library, adding a reference to the application which called the library which called the "missing" library (if you know what I mean) removed the warning.

Thanks for the input folks!

Bruce
Eh, not it's not clear for me. Can you try explaining again please?
Benjol
Basically, the original assembly (we'll call it AS0) called another assembly (we'll call this one AS1). AS1 was in the reference list of AS0, however, AS1 called still another assembly (we'll call it AS2) and, of course, AS2 is in the reference list of AS1 but NOT in the reference list of AS0. To solve the problem, I added AS2 to the reference list of AS0. That did the trick.
Bruce