Resolving DLL version conflict

If you’re using a third party library which was compiled with old version of some common library (like log4net) you will get a dll conflict when you try to run it.

.Net allows you to do binding redirect in App.config as long as the publicKeyToken is the same between versions.

<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="CommonLibrary" publicKeyToken="b32731d11ce58905" culture="neutral" />
<bindingRedirect oldVersion="1.0.0.1" newVersion="1.0.0.2" />
</dependentAssembly>
</assemblyBinding>
</runtime>

Comments

Popular posts from this blog

Parse XML to dynamic object in C#

C# Crop white space from around the image