Reputation: 11
I have 2 DLLs. B depends on A. I have a couple Windows services that use only the classes in A. Do I need to include DLL B in these Win svcs (add a reference to it)?
The reason I ask is that I've tried both ways: including A and B, and include only A. In one win svc everything seems to work fine with only A. In another, I get errors saying "can't load A because it relies on B which can't be found" (words to that effect). So I'm confused. And does it matter for this dilemma whether I build the DLL and Win Svcs as Release vs Debug?
Upvotes: 0
Views: 491
Reputation: 27913
The release/debug configuration shouldn't matter. Most of the time, the .net runtime doesn't load a dll until it needs to. At runtime, the JIT-compiler may discover that it needs to compile a method which references a Class/Struct defined in an assembly that is not loaded. At that time, it will attempt to resolve (locate) the assembly file.
The exception will usually have enough clues to determine what is going on, so here are some ideas to get you started:
Upvotes: 1