Loading multiple versions of the same assembly

If both assemblies are compatible you can define in the app.exe.config or web.config file to always use the new version by declaring bindingRedirect .

example

<configuration>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1" appliesTo="v1.0.3705">
        <dependentAssembly>
            <assemblyIdentity name="Regcode" publicKeyToken="b03f5f7f11d50a3a" culture=""/>
            <bindingRedirect oldVersion="0.0.0.0-65535.65535.65535.65535" newVersion="1.0.3300.0"/>
        </dependentAssembly>
    </assemblyBinding>
  </runtime>
</configuration>

this config entry for dotnet 1.0 tells the asembly loader always to use version 1.0.3300.0 no matter what is compiled into the calling exe. The same is possible with newer dotnet versions


Here are a couple posts from here on SO that describe how to load multiple versions of the same assembly:

This post describes how to reference two different versions of log4net. See @Joe B.'s comment under the accepted answer for a bit more detail on exactly how he solved his problem.

3rd party libraries refer to different versions of log4net.dll

That answer refers to this link:

Using different versions of the same assembly in the same folder

Within this thread, there is a caution about loading different versions of the same assembly in the same context and references this link on MSDN:

http://msdn.microsoft.com/en-us/library/dd153782.aspx#avoid_loading_multiple_versions

Here is another with an answer that suggests using AssemblyResolve: Reference two equal assemblies, only public keys differ