I have the following solution structure:
Solution
\_ProjectA
\_ProjectB (uses 3rd party DLL v1)
\_ProjectC (uses 3rd party DLL v2)
Project A has no direct reference to the 3rd party DLL's, it just invokes methods from project B and C.
Project B and C DLL reference's properties have Specific Version
set to True
.
I get the following warning during build:
"No way to resolve conflict between X and Y. Choosing Y arbitrarily".
As expected, only the project using the chosen DLL works properly. How do I force those projects to use those specific versions?
How do I force those projects to use those specific versions?
You can't, basically. Certainly not even close to easily. Even though Project A doesn't directly use the 3rd party DLLs, the CLR will still have to load them... at which point you've got an AppDomain with the following assemblies loaded:
I don't think you can load multiple versions of the same assembly into the same AppDomain
at a time.
Options:
AppDomain
s, one using project B and its version of the third party assembly, and one using project C and its version. In my experience, this sort of thing is very fiddly.The last of these options is going to be the most maintainable by far, I suspect.
See more on this question at Stackoverflow