I have a dll A that implicitly links to a dll Z. dll A also explicitly links to a dll B, which implicitly links to dll Z’ (a different version of the Z dll).
Some additional factors are:
dll B can be located anywhere in the system, its location is revealed to dll A at runtime through an XML file, and it is loaded using loadlibrary.
Due to restrictions beyond our control, we are not able to change the environment path.
The problem I have is ensuring dlls A and B use the correct versions of the Z dll.
What options do I have?
You can fix this by modifying the manifest of one of the two A or B so that they both link against the same version of Z. The manifest is likely embedded and so you’ll need Microsoft’s Manifest Tool mt.exe which should be available with the SDK. This happens frequently when you link against 3 party tools that were linked against a different runtime than the one that you use.