0

I have a question about side-by-side assemblies.

Here's the situation:

I have an executable, app.exe, which loads plugins by searching a plugins directory. app.exe depends on a certain A.dll.

I'm developing a plugin which depends on an older, customized version of A.dll that has the same name. Updating this older, customized version to the newer version is impossible, so I thought I might be able to load the two A.dll files simultaneously.

Here's the directory structure:

\bin
    app.exe
    A.dll (newer version)
    \plugins
        myplugin.dll

Both versions of A.dll themselves depend on a huge number of other DLLs, which could have similar version problems. (I should also mention I'm working with a 64-bit application, if that makes a difference.)

How do I set this up in Visual Studio such that I can load both A.dll libraries at the same time, so that myplugin.dll uses the older version, whereas app.exe uses the newer version?

dashik
  • 67
  • 1
  • 1
  • 6

1 Answers1

0

Since these are plugins, you load them by calling LoadLibrary, or similar. In which case you can simply pass the full path to the DLL in order to load it.

David Heffernan
  • 601,492
  • 42
  • 1,072
  • 1,490
  • Does the fact that `A.dll` has many other dependencies matter? In reality, it's more like `myplugin.dll` calls on `dep.dll`, which calls on `bin\A.dll`. I want `dep.dll` to call `bin\plugins\A.dll` instead (but can't modify `dep.cpp`). If I try `LoadLibrary` in `myplugin.cpp`, I get a "First chance exception" (Entry Point Not Found) error. What do I do in this case? – dashik May 16 '14 at 18:31
  • None of that detail is in the question – David Heffernan May 16 '14 at 18:48