I've run into a situation where an application has multiple (incompatible) versions of one or more dll.
app.exe
a.dll // v3.0
...
plugins/foo/foo.dll
plugins/foo/a.dll // v4.0
plugins/foo/...
In this example, app.exe depends on a.dll v3.0 and foo.dll depends on a.dll v4.0. Due to the search order of LoadLibrary the a.dll v3.0 next to my exe is loaded first, then since it's already in memory, the later v4.0 is skipped.
Assuming I cannot:
- rename the dependent dll (
a.dllin this case) - modify
app.exenorfoo.dllto upgrade/downgrade them to a commona.dllversion
Is there a way to load multiple versions of the same-named dll to work around this? I saw this answer regarding AppDomain but that is for managed C# applications, my use case is a native C++ dll.