Recently, I had a problem where I was using a different version of an assembly for my custom app, but it had a dependency on a dll that is referring to another version of that assembly.

To be more particular, I am using Subsonic version 2.2 (http://www.subsonicproject.com/) which is an excellent DAL framework but a pre-built library I am using has a dependency on Subsonic version 2.0.3.

To force a particular version of the assembly, we can use the assembly binding.

Here is a sample:

<runtime>
<assemblyBinding xmlns=”urn:schemas-microsoft-com:asm.v1″>
<dependentAssembly>
<assemblyIdentity name=”SubSonic” publicKeyToken=”eadb47849839a332″ />
<bindingRedirect oldVersion=”2.0.0.0-2.0.4.0″ newVersion=”2.2.0.0″ />
</dependentAssembly>
</assemblyBinding>
</runtime>