Avoid Version errors with Assembly Binding

This is the code to bind the most commonly used assemblies

<?xml version="1.0" encoding="UTF-8"?>
<runtime>
   <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
         <assemblyIdentity name="Telerik.Sitefinity" publicKeyToken="b28c218413bdf563" culture="neutral" />
         <bindingRedirect oldVersion="0.0.0.0-65535.65535.65535.65535" newVersion="" />
      </dependentAssembly>
      <dependentAssembly>
         <assemblyIdentity name="Telerik.Sitefinity.Model" publicKeyToken="b28c218413bdf563" culture="neutral" />
         <bindingRedirect oldVersion="0.0.0.0-65535.65535.65535.65535" newVersion="" />
      </dependentAssembly>
      <dependentAssembly>
         <assemblyIdentity name="Telerik.Web.UI" publicKeyToken="121fae78165ba3d4" culture="neutral" />
         <bindingRedirect oldVersion="0.0.0.0-65535.65535.65535.65535" newVersion="" />
      </dependentAssembly>
   </assemblyBinding>
</runtime>


Add this to your web.config, and you shouldn't need to wait anymore for control vendors in the marketplace to recompile against the latest release.

The root problem is .net is compiled against specific assembly versions for security reasons.  When you update Sitefinity to 8.2, lets say, my dll is compiled against 8.1... so when sitefinity loads my DLL is crashing saying "HEY, WHERE'S Telerik.Sitefinity.Dll v8.1.5000.0!".  This tells it to just calm down, and use 8.2, it's all good...

So obviously missing here are the "newVersion" numbers. Just browse over to your bin directory and inspect the properties of the above DLLs to get the version # to paste in. So if you just updated to 4.2.0.0 then put that in as the newversion.

Reference Url: Link

Did you like this post, did I help you out, are you feeling generous

  Buy me a beer

Comments