views:

360

answers:

3

I write programs used internally by our company. I've created several support DLLs that I reference in many projects. (a generic data access helper for example) Instead of having a copy of "datatools.dll" in every program directory (seems to be default behavior) I would like to have one copy that can be referenced by many programs. Kinda like my own system32 directory.

I have added a "Reference path" to my project. I compile the project then the deployment project. The installer works fine. The shared dlls are in my Reference path. But when I run the program I get the error "System.IO.FileNotFoundException: Could not load file or assembly 'datatools.dll, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified." If I move datatools.dll into the same folder as the exe the program runs without a problem.

Can I create and use a shared location for shared dlls? Or is this just a bad idea?

+2  A: 

You could sign (using VS2k8, look in the project property tabs) 'em and put them in the GAC

Muad'Dib
Thanks all for the quick response. I am using VS2k8. I looked at the Sign option you and Yuliy mentioned but fear it is over my head. I'll just live with multiple copies on my users machines.
mohnston
+2  A: 

If you're using .NET, the typical approach for this kind of problem is to deploy those shared assemblies to the GAC (Global Assembly Cache), ideally as its own deployment project.

Yuliy
+1  A: 

Sounds like you have a multi-project solution. Check to make sure all projects who reference the DataTools.dll assembly are pointing to the correct (new) location.

Depending on your IDE, you might need to try somthing funky like removing the old reference, building it (and watch it crash) then re-add it from the new location.

JonnyD