Using SiteFinity 4 is frustrating because right now it isn’t complete and has many issues. One such issue is adding RadControls to a page will break the site giving a yellow screen of death complaining about an assembly.

Could not load file or assembly ‘Telerik.Web.UI, Version=2010.3.1109.40, Culture=neutral, PublicKeyToken=121fae78165ba3d4’ or one of its dependencies. The located assembly’s manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

This is because according to Telerik, SiteFinity uses RadControls but they are not in sync with the release of the RadControls package.

The Sitefinity isntaller and project manager come with their own version of the Telerik.Web.UI.dll. The version which was used to build the system. We try to upgrade the controls in the CMS frequently, but sometimes they are not the latest controls released.

The problem you are experiencing is because almost the whole UI of Sitefinity is built using RadControls for ASP.NET Ajax. This means that the Sitefinity assemblies reference the particular version of Telerik.Web.UI.dll which is in the bin of the Stiefinity website. When you have upgraded the controls from the VS dialog you have substituted the assembly with a newer one. To fix the problem you must either revert the assembly to in the bin folder or use a binding redirect.

So to fix the problem, you need to add assemblyBinding to the web.config (which is not right in my opinion).

 <runtime>
      <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
        <probing privatePath="bin;sitefinity\admin\bin" />
        <dependentAssembly>
          <assemblyIdentity
            name="Telerik.Web.UI"
            publicKeyToken="121fae78165ba3d4"
            culture="neutral" />
          <bindingRedirect
            oldVersion="2010.3.1109.40"
            newVersion="2010.3.1317.40" />
        </dependentAssembly>
      </assemblyBinding>
  </runtime>

The <runtime> node can be put under the <configuration> node in any spot.

Could not load file or assembly ‘Telerik.Web.UI, Version=2010.3.1109.40, Culture=neutral, PublicKeyToken=121fae78165ba3d4’ or one of its dependencies. The located assembly’s manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

Advertisements