views:

330

answers:

4

Hello,

We have many projects using interop & related dll...all projects have individual dll reference with setup,but basically all of them use same dll .so that's many times creates problem if any dll register/Unregister while installation/Unistalling of setup.

We need to place dll at one location & all projects require to use dll reference from that location to avoid register/deregister problem.but wondering about how actual reference located in .net for dependencies.

& above approach can create problem if setup location changed or dll reference location changed.

how can we do that ?any better solution or workaround for that?

Thanks.

A: 

Put the assembly/interop dll into the Global Assembly Cache (GAC).

References:

How to deploy unmanaged dll into GAC
http://blogs.msdn.com/yizhang/archive/2007/06/17/how-to-deploy-unmanaged-dll-into-gac.aspx

Global Assembly Cache
http://msdn.microsoft.com/en-us/library/yf1d93sz.aspx

Robert Harvey
A: 

Use Merge modules: Merge modules provide a standard method by which developers deliver shared Windows Installer components and setup logic to their application. ...

This link might be helpful or just google for "visual studio setup project merge module".

van
A: 

Hello,

Thanks for reply ..i have tried to look into GAC & Register my assembli into that.

And I found Installing Assembly In GAC does not driectly allow user to add refrence of that dll via application,for that user Require to Create Registry Key.

And after that ,how that will work with setup installtion ,do we always need to copy that assembly in GAC folder while installtion & creation of that Registry Key??

Does there any alternative way to handle shared dll from one loaction ??

+2  A: 

Personally I like to make all my applications include all the DLLs referenced for a couple of reasons:

  • I can do a clean install and uninstall to remove all traces of my application without worrying about breaking anything
  • If I make a change to the shared DLL i don't have to worry about breaking other applications

But if you really need one location, you can register the DLL in the Global assembly cache. If you use a deployment tool like Wix this is pretty straightforward. Alternatively you could use a custom action to do the registration in the GAC

Conrad