Resolving Assembly Binding Errors After Sitefinity Upgrade

Resolving Assembly Binding Errors After Sitefinity Upgrade

We recently upgraded one of our Sitefinity installations from version 14.4.8144 to 14.4.8146. While the upgrade itself was relatively straightforward, we encountered an unexpected issue when a team member tried to clone and run the project.

The Problem

When Josh attempted to run the freshly cloned project, he encountered numerous binding errors similar to this:

One or more errors occurred. -> Could not load file or assembly 'Telerik.Sitefinity.Frontend.Media, Version=14.4.8144.0, Culture=neutral, PublicKeyToken=b28c218413bdf563' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

What made this particularly puzzling was that the site ran perfectly fine on my machine, despite the upgrade to 14.4.8146.

The Initial Approach

My first instinct was to suggest adding binding redirects to the configuration:

<dependentAssembly>
  <assemblyIdentity name="Telerik.Sitefinity.Services.Events" publicKeyToken="b28c218413bdf563" culture="neutral" />
  <bindingRedirect oldVersion="0.0.0.0-14.4.8146.0" newVersion="14.4.8146.0" />
</dependentAssembly>
<dependentAssembly>
  <assemblyIdentity name="Telerik.Sitefinity.Frontend.Media" publicKeyToken="b28c218413bdf563" culture="neutral" />
  <bindingRedirect oldVersion="0.0.0.0-14.4.8146.0" newVersion="14.4.8146.0" />
</dependentAssembly>

Unfortunately, this approach backfired. After implementing these redirects, every single sub-assembly of Telerik.Sitefinity.All.dll began throwing the same error. After adding several more binding redirects and enduring multiple rebuild and boot cycles, it became clear this wasn't the correct solution. It also didn't explain why the application was running fine on my machine without any such modifications.

The Root Cause and Solution

After some reflection, I remembered a similar issue I'd encountered previously. The problem wasn't with the binding redirects at all, but rather with the NuGet package restoration process.

Upon investigation, we discovered an invalid NuGet source with outdated credentials in the nugetSources configuration. This problematic source was preventing package restoration across the board, even for packages that weren't sourced from it.

The solution was remarkably simple:

  1. Disable the problematic NuGet source
  2. Force a package restore

This allowed the Telerik.Sitefinity.All package to properly upgrade from 14.4.8144 to 14.4.8146, resolving the binding errors.

Key Takeaways

  1. Look beyond the immediate error: The binding errors were a symptom, not the root cause
  2. Consider package management issues: NuGet configuration problems can manifest in unexpected ways
  3. Remember that sub-assemblies matter: Since the sub-assemblies were part of the .All package, they weren't visible as individual missing packages in NuGet

When troubleshooting similar issues, check your NuGet source configurations first, especially if you're working with packages like Telerik.Sitefinity.All that contain multiple sub-assemblies not individually visible in package management.

Subscribe to TSD

Don’t miss out on the latest posts. Sign up now to get access to the library of members-only posts.
jamie@example.com
Subscribe