Feedback
Did this article resolve your question/issue?

   

Article

Upgrade: Sitefinity Could not load file or assembly error

« Go Back

Information

 
TitleUpgrade: Sitefinity Could not load file or assembly error
URL NameCould-not-load-file-or-assembly-error-when-upgrading-Sitefinity
Article Number000188072
EnvironmentProduct: Sitefinity
Version: 11.x, 12.x, 13.x
OS: All supported OS versions
Database: All supported Microsoft SQL Server versions
Question/Problem Description

After an upgrade of Sitefinity to a higher version upon startup, an error shows up.
An error is encountered after upgrading Sitefinity to a higher version or adding a new NuGet package to it. The upgrade passes and completes, but the site shows an error message on startup.
Upgrade results in errors after site startup. The upgrade summary contains an error for an incorrect assembly version.
After applying a security patch, when trying to login to the backend a popup box appeared with an error about an assembly reference. 
Search is not working and it's not returning any results.
When trying to load the site, a blank screen appears.
Seeing the below error when browsing to the Sitefinity backend after upgrade.

Steps to Reproduce
Clarifying Information
The exception is in the format, where the highlighted 'assembly name' and 'version number' will vary based on the specific assembly problem encountered.
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.
 
Error MessageCould not load file or assembly 'assembly name, Version=version number, Culture=neutral, ​PublicKeyToken=b28c218413bdf563' or one of its dependencies.
Defect Number
Enhancement Number
Cause

The error message indicates one of the following problems:

  • There is an assembly version mismatch that can affect any assembly or NuGet package.
Example: If 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.
Since 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.
  • A certain assembly with a specific version can not be found but is required for the site to successfully start-up.
Example: If 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.

Incorrect assembly name in the web.config.
Resolution

Assembly version mismatch

Perform the following:
  1. Open the web.config file, search for <bindingRedirect> rules that point to version 10.2.6600.0 (based on the sample error above), and correct them to point to the version 11.0.6700.0.
    Also, check if those binding redirects are needed or 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:
  • (Recommended) Make sure to upgrade their assembly references to 11.0.6700.0 and compile them with Sitefinity 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:
<runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
        <dependentAssembly>
<assemblyIdentity name="Telerik.Sitefinity.Utilities" publicKeyToken="b28c218413bdf563" culture="neutral"/>
            <bindingRedirect oldVersion="0.0.0.0-65535.65535.65535.65535" newVersion="11.0.6700.0"/>
        </dependentAssembly>
    </assemblyBinding>
</runtime>
3. Ensure that the name of the assembly from the error is correct in the binding redirects.

For more information, see Microsoft Docs, <bindingRedirect> Element https://docs.microsoft.com/en-us/dotnet/framework/configure-apps/file-schema/runtime/bindingredirect-element
  • Make sure that there are no old assemblies in the /bin folder. To know that enable the File version column in the Windows Explorer. 
User-added image
User-added image
 
With very complex sites sometimes it is hard to determine the third-party assembly or custom class library that references the assembly with the incorrect version. In this case, 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.

Missing assembly

To resolve this:
  • Check if the assembly from the error (e.g.: "Telerik.Sitefinity.Utilities") is added as assembly reference in the project. If it is not added:
  • In case the problem with the missing assemblies occurs only if the project is moved to another environment – for example, from Test to UAT server - then it means that not all referenced assemblies are moved with the project files. For example, an assembly may not be taken from the bin folder of the site, but from another folder that is not moved to the target server.

 
Workaround
Notes
Progress Articles: 
 "Thread was being aborted" exception in the error logs  
 Increase OpenAccess connection timeout  

References to Other Documentation:
Sitefinity Documentation, Upgrade procedure https://www.progress.com/documentation/sitefinity-cms/upgrade
Sitefinity Documentation, Download and install the Project Manager https://www.progress.com/documentation/sitefinity-cms/download-and-install-the-project-manager
 
Last Modified Date6/9/2021 2:28 PM
Attachment 
Files
Disclaimer The origins of the information on this site may be internal or external to Progress Software Corporation (“Progress”). Progress Software Corporation makes all reasonable efforts to verify this information. However, the information provided is for your information only. Progress Software Corporation makes no explicit or implied claims to the validity of this information.

Any sample code provided on this site is not supported under any Progress support program or service. The sample code is provided on an "AS IS" basis. Progress makes no warranties, express or implied, and disclaims all implied warranties including, without limitation, the implied warranties of merchantability or of fitness for a particular purpose. The entire risk arising out of the use or performance of the sample code is borne by the user. In no event shall Progress, its employees, or anyone else involved in the creation, production, or delivery of the code be liable for any damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or other pecuniary loss) arising out of the use of or inability to use the sample code, even if Progress has been advised of the possibility of such damages.