Problem: Could not load file or assembly

You can encounter this type of error after upgrading Sitefinity CMS to a higher version or after adding new NuGet package to it. The upgrade passes and completes, but the website shows an error message on startup.

Because the upgrade of Sitefinity CMS consists of replacing the Sitefinity CMS specific assemblies with assemblies that have higher version, any common Microsoft .NET assembly related problem may occur during the upgrade.

The exception occurs in the following format:

Could not load file or assembly 'assembly name, Version=version number, Culture=neutral, 
PublicKeyToken=b28c218413bdf563' or one of its dependencies.

The exception can relate to Telerik.Sitefinity assemblies or to any other assembly. 
The error message indicates one of the following problems:

  • A certain assembly with specific version cannot be found, but is required for the site to successfully start up.
  • There is an assembly version mismatch that can affect any assembly or NuGet package.

Solution: Assembly version mismatch

EXAMPLE: You are upgrading Sitefinity CMS from version 10.2.6600.0 to version 11.0.6700.0. When the site initializes the following error message appears:
Could not load file or assembly 'Telerik.Sitefinity.Utilities, Version=10.2.6600.0, Culture=neutral, PublicKeyToken=b28c218413bdf563' or one of its dependencies.

Because the site is upgraded to 11.0.6600.0 there must be no more assemblies with version 10.2.6600.0. There must be either a leftover assembly Telerik.Sitefinity.Utilities.dll with version 10.2.6600.0 or a <bindingRedirect> rule in web.config that instructs the compiler to search for assembly with this version.

Perform the following:

  1. Open the web.config file, search for <bindingRedirect> rules that point to version 10.2.6600.0, and correct them to point to the version 11.0.6700.0
    Also, check if these binding redirects are required, else remove them.
  2. Check any third party or custom assemblies that may contain a reference to 10.2.6600.0 assemblies. 
    If there are such third party or custom assemblies, perform one of the following:
    • Make sure to upgrade their assembly references to 11.0.6700.0 and compile them with Sitefinity CMS version 11.0.6700.0.
    • Open the web.config file and use <bindingRedirect> to redirect all assemblies from 10.2.6600.0 to 11.0.6700.0.
      EXAMPLE: Use the following example for a binding redirect: For more information, see <bindingRedirect> Element.

With very complex sites sometimes is hard to determine the third-party assembly or custom class library that references the assembly with incorrect version. In this case, you can configure ASP.NET to indicate what is calling the missing assembly. This can help troubleshoot the version mismatch. 

To do so, perform the following:

  1. Run C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\FUSLOGVW.exe
  2. Click Settings.
  3. Select Log in exception text.
  4. Click OK.
  5. Restart the application.

Solution: Missing assembly

EXAMPLE: You are upgrading Sitefinity CMS from version 10.2.6600.0 to version 11.0.6700.0. When the site initializes the following error message appears:
Could not load file or assembly 'Telerik.Sitefinity.Utilities, Version=11.0.6700.0, Culture=neutral, PublicKeyToken=b28c218413bdf563' or one of its dependencies.

In this case the assembly is the correct version, but it is missing from the site.

This can be due to one of the following:

  • The version of the assembly is the same as the version of Sitefinity CMS, so you should check, if this assembly Telerik.Sitefinity.Utilities is added as assembly reference in the site. If it is not added, add it by downloading it from Sitefinity NuGet repository.
  • In case the problem with missing assemblies occurs only when you move the upgraded site to another environment – for example, from Test to UAT server, then it means that not all referenced assemblies are moved with the site files. For example, a referenced assembly may not be taken from the bin folder of the site, but from another folder that is not moved to the target server.

Was this article helpful?