How does a project find dlls that it uses - where do I put them?

  • Thread starter Thread starter HONOREDANCESTOR
  • Start date Start date
H

HONOREDANCESTOR

I am using some dlls from a third party, and I am writing a
multiproject solution that is supposed to use them. So I copied the
dlls to a bin directory in one of the projects, but the project does
not find them when I compile it.
Where should I put the dlls? Should I use 'add / reference'?
Thanks,
HA
 
I am using some dlls from a third party, and I am writing a
multiproject solution that is supposed to use them. So I copied the
dlls to a bin directory in one of the projects, but the project does
not find them when I compile it.
Where should I put the dlls? Should I use 'add / reference'?

If the DLLs are mainly used by a single application, put them in the
directory containing the executable file. Otherwise you can install the DLL
into the Global Assembly Cache (GAC) in order to enable more than one
application to use the libraries.

At design time simply add a reference to the DLL.
 
and to explicitly copy the dll to the bin folder, right click on the
Referenced library and make sure the Copy Local is set to True.

Regards,

Trevor Benedict
MCSD
 
Trevor said:
and to explicitly copy the dll to the bin folder, right click on the
Referenced library and make sure the Copy Local is set to True.

Given that I've spent an inordinate amount of my time trying to get rid
of this "Copy Local" option, may I ask why you recommend this?

If I've built and distributed a "shared" assembly, I'd far rather it was
safely in the GAC, stored once and re-used all over the machine, rather
than having loads of [potentially incompatible] copies of it springing
up all over the place ...

Regards,
Phill W.
 
Phill,
I did not mean it as a recommendation, an available option was highlighted.

What are the requirements for an assembly to reside in the GAC. Whenever you
wrap an assembly without a strong name you don't have an option.

Moreover, xcopy becomes easier when the files are in one location.

Regards,

Trevor Benedict
MCSD
 
Back
Top