I have two web services that are both contained underneath a common subdirectory
CompanyName\Service1
CompanyName\Service2
Each directory has a bin folder that contains its dlls. I’ve now come to a point where some of this code has been restructured and has quite a few common components and i’d like to be able to ‘share’ them. What would be the best way to go about this? Below is a list of solutions I have found (along with the negatives).
- AssemblyResolving – Security issues.
- codeBase element inside of web.config – Hardcoded paths to component locations.
- GAC – Currently non of our products use the GAC and I personally have very limited knowledge on using it. This one may just be a fear of the unknown.
- Place assemblies in both locations – Harder to update in place patches. Need to ensure files get replaced in all locations.
Am I missing anything else that could be helpful to me? Would anyone recommend using any of the options listed above?
Additionally, I cannot combine the two services into as they are currently used by third parties (they were build separately).
i would go for the GAC, since is solves all your other problems that you listed,
plus it looks natural that a shared library will be in one location.
to use the GAC, all you need it to strong name the dll, and drop it in the GAC in install time
it also gives you good side by side versioning options (one WS using version 1.0.0.0 , another can use 1.0.0.1)