Reputation: 2590
Background
My assembly (a DLL) is being loaded by a third party application, I have no control over how it is loaded. The third party app will load all assemblies in a given directory.
Problem
If my assembly and another assembly use the same library, but different versions, they will both be in the same directory and will conflict. I have already researched the <probing>
config file directive, and Assembly Resolvers, so I know how to create a subdirectory and have my assembly search it for references.
Need
I need some way of configuring visual studio to build my main DLL into the root folder, and all references into a subfolder. Preferably during build (since I configured my build to go directly to the correct folder.
Upvotes: 6
Views: 6246
Reputation: 1139
You can put your references in separate folders. Here is how:
Now select & add any reference assembly to this folder. You can add files as a link
Right-Click References and go to Add Reference -> Browse
Navigate to your newly created folder and select assemblies.
Set Copy to Local to True for each Reference.
Build your project.
Upvotes: 4