Okay, well, to resolve that error we need to introduce a binding redirect. I thought 2Sxc automatically added these, so maybe the first step is to see if there's a newer version of 2Sxc to upgrade to (preferably one of their LTS releases).
If you still continue to see that error, that's where the binding redirects come into play. If you look at your
web.config file (either via the file system or through the Config Manager in the Persona Bar) and search for
bindingRedirect you will see a section of the file with entries like this:
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" />
<bindingRedirect oldVersion="0.0.0.0-32767.32767.32767.32767" newVersion="18.104.22.168" />
What this is saying is that the assembly (DLL file, compiled code) with the given identity (name is
Newtonsoft.Json, signed with the public key
30ad4fe6b2a6aeed) is valid for use when any version is requested (i.e. in the range from version
0.0.0.0 to version
32767.32767.32767.32767) and should use the version
newVersion value needs to match the version of the DLL file in the
So, in your case, you need to see if there's an existing binding redirect for
Microsoft.Extensions.DependencyInjection.Abstractions. If there is, make sure version 22.214.171.124 is included in the
oldVersion range. If there isn't, you'll want to add one. The tricky part here is knowing the specific version of the assembly file in the
bin to use for the
newVersion. There are many different versions associated with the file, so it's not very straightforward to determine what the correct version is. If you use the wrong version, your site won't work at all. You should be able to retrieve the version using Powershell, with the following snippet (using your website's path):
After you've added/updated the binding redirect, you'll want to see if that resolved the issue. It may be that there's another missing binding redirect that you need to add next.
If you get into a scenario where your versions don't match and the site isn't working, I have a Powershell module which has a command to synchronize the binding redirects in the
web.config with the files in the
bin (though it won't add new binding redirects). To use that, run
Install-Module -Name BindingRedirects (see the getting started docs if
Install-Module isn't available on your system). Once it's installed, call
Sync-BindingRedirect 'C:\inetpub\wwwroot\mysite.com\web.config' to update any incorrect binding redirects.
Hope it helps!