Reputation: 6286
I want to share a dll in between two projects.
Is it necessary to put the dll in GAC only or can I place it in any folder?
Upvotes: 0
Views: 385
Reputation: 11
In your situation I'd recommend using your source control system to enforce structured sharing, not the GAC.
The process in Subversion:
This gives you the best of both worlds:
Upvotes: 1
Reputation: 273244
I would strongly recommend to keep it in the Bin folder of each Project. Do not attempt to share it unless that is really (really) necessary.
The second best option is to put in a shared folder (using a relative path) and configure that in each Projects config file (Probing path). Note that you will always have to update the 2 projects simultaneously. If the assembly holds types that are used to communicate between the 2 projects then that makes sense, but otherwise it is a needless complication.
The very last option is to put it into the GAC
Upvotes: 2
Reputation: 499002
The assembly loader will look for the assembly in several places, one of which is the execution directory.
This means that you can simply copy to multiple directories.
See How the Runtime Locates Assemblies
on MSDN.
Upvotes: 1