Home All Groups Group Topic Archive Search About

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

Author
28 Nov 2007 8:12 PM
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

Author
28 Nov 2007 9:14 PM
Spam Catcher
HONOREDANCES***@yahoo.com wrote in news:f222fed1-6780-44f5-b336-
e0000a98d***@e10g2000prf.googlegroups.com:

> Should I use 'add / reference'?

Yes.

--
Author
28 Nov 2007 10:01 PM
Herfried K. Wagner [MVP]
<HONOREDANCES***@yahoo.com> schrieb:
>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.

--
M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://dotnet.mvps.org/dotnet/faqs/>
Author
28 Nov 2007 10:21 PM
Trevor Benedict
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

Show quoteHide quote
"Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> wrote in message
news:%23rblxogMIHA.3852@TK2MSFTNGP06.phx.gbl...
> <HONOREDANCES***@yahoo.com> schrieb:
>>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.
>
> --
> M S   Herfried K. Wagner
> M V P  <URL:http://dotnet.mvps.org/>
> V B   <URL:http://dotnet.mvps.org/dotnet/faqs/>
Author
29 Nov 2007 12:56 PM
Phill W.
Trevor Benedict wrote:

> 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.
Author
29 Nov 2007 5:28 PM
Trevor Benedict
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

Show quoteHide quote
"Phill W." <p-.-a-.-w-a-r-d-@-o-p-e-n-.-a-c-.-u-k> wrote in message
news:fimct3$1up$1@south.jnrs.ja.net...
> Trevor Benedict wrote:
>
> 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.