This totally worked for me. NOTE: You need NO namespace on the configuration
tag. And you MUST have a namespace on your assemblyBinding
tag.
<assemblyBinding> Element for <runtime>
<!-- important: no namespace -->
<configuration>
<runtime>
<!-- important, must have this namespace -->
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Strongly.Named.Assembly" publicKeyToken="xxx" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
Do both of those or else it will not read it. If it is giving an error that it cannot load anything but 2.0.0.0 in this example, then it is not picking up the config elements properly.
This also only works on strongly named assemblies. To find out if something is strongly named run the following command from the VC command window
open (start menu > all programs > visual studio > visual studio tools > visual studio command prompt)
Then run:
sn -vf "path-to-assembly.dll"
If it returns that it is valid, then it's strongly named.
source:
http://blog.codingoutloud.com/2010/03/13/three-ways-to-tell-whether-an-assembly-dl-is-strong-named/