Start a conversation

Evoq 10.0.x fresh install fails before the installation wizard (System.Runtime.CompilerServices.Unsafe version mismatch)

Overview

When performing a fresh, manual installation of Evoq 10.0.1 or 10.0.2 from an unmodified Install package, the site fails on every request before the installation wizard is displayed. Sites that are upgraded from a 9.x version are not affected.

 

The error manifests in the DNN logs (Portals\_default\Logs) like this:

[FATAL] ... System.IO.FileLoadException: Could not load file or assembly
'System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's
manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
   at DotNetNuke.HttpModules.DependencyInjection.ServiceRequestScopeModule.Context_EndRequest

Root Cause

On a fresh 10.0.x install, the web.config that ships in the Install package does not contain an assembly binding redirect for System.Runtime.CompilerServices.Unsafe. The application requests version 4.0.4.1, while the file present in the bin folder is version 6.0.3.0. On .NET Framework, that mismatch can only be resolved by a binding redirect, so without it every request throws the FileLoadException above and the wizard never renders.

Troubleshooting

The target version in the redirect must match the exact version of the file in your bin folder (6.0.3.0). A target of 6.0.0.0 will fail the same way. For more background on this class of error, see The Located Assembly's Manifest Definition Does Not Match the Assembly Reference.

Solution

This has been corrected in a newer release. The recommended fix is to install from an updated package, in which the required redirect is already present:

  1. Download the latest installation package from Download DNN and Evoq installation and upgrade packages.
  2. Perform the installation using this updated package.

Workaround (for an existing 10.0.1 / 10.0.2 package)

If you need to complete an install from a package you already have, you can add the missing redirect manually:

  1. Make a backup copy of web.config in the site's root folder (next to Default.aspx).
  2. Open web.config and locate the <runtime> / <assemblyBinding> section. Directly below the <probing ... /> line, inside the same <assemblyBinding> element, add:
<dependentAssembly>
  <assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
  <bindingRedirect oldVersion="0.0.0.0-6.0.3.0" newVersion="6.0.3.0" />
</dependentAssembly>
  1. Save the file and recycle the site's application pool so it restarts with the new setting.
  2. Browse to the site; the installation wizard should now load. Complete the wizard. On the Database Information step, enter your actual SQL Server name rather than the default .\SQLExpress if your database is a default instance.
  3. When the wizard reports that the installation is complete, recycle the application pool once more so the site starts cleanly with all components in place.

If a different "Could not load file or assembly" error appears, or the wizard stops part-way, capture the newest log from Portals\_default\Logs and a screenshot of the error page and share them with our Support team.

Choose files or drag and drop files
Was this article helpful?
Yes
No
  1. Ibiso Barimalaa

  2. Posted

Comments