Problem with dynamically loaded dll RRS feed

  • Question

  • I have some dll:s in a separate folder. These are dll:s for the integration part of a main application. I want to be able to release new integrations (with higher version numbers) without recompiling the main application.

    The Main application solutions deployment project writes to the main app folder and the integration deployment project to the integration folder.

    As long as both projects have the same version number it works. If I update the integration app to a higher version number, a LoaderException is thrown.

    But the strange thing is if I run the main application in debug mode and hard code the path to the dll (“c:\program\MainApp\integration\integration.dll”) (it’s the same path used in release mode) everything works.

    Any ideas?

    Thursday, June 5, 2008 7:21 AM


  • The assembly loader pays attention to the version number unless the assembly is found on the probing path.  I assume that's what happens when you're debugging.  You'll want to increment the revision number, the 4th number in the version number to avoid loader problems.  Or use a publisher policy to tell the loader to redirect to the new version, check out the docs for the <bindingRedirect> element of the .config file.
    Hans Passant.
    • Marked as answer by Zhi-Xin Ye Monday, June 9, 2008 11:28 AM
    Thursday, June 5, 2008 11:58 AM