You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a Guide to Fix a Problem after a Dnn Update
Problem
User is doing DNN upgrade to latest DNN 9.10.2 using upgrade zip.
Before upgrade, DNN installation is version 9.10.1 (or older) and it has 2sxc v13+ module installed.
After upgrade, on first run, there is Server Error.
Could not load file or assembly 'Microsoft.Extensions.DependencyInjection.Abstractions' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.IO.FileLoadException: Could not load file or assembly 'Microsoft.Extensions.DependencyInjection.Abstractions' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Assembly Load Trace: The following information can be helpful to determine why the assembly 'Microsoft.Extensions.DependencyInjection.Abstractions' could not be loaded.
WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
Stack Trace:
[FileLoadException: Could not load file or assembly 'Microsoft.Extensions.DependencyInjection.Abstractions' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)]
[FileLoadException: Could not load file or assembly 'Microsoft.Extensions.DependencyInjection.Abstractions, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)]
System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +0
System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +232
System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean forIntrospection) +113
System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +23
System.Reflection.Assembly.Load(String assemblyString) +35
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +48
[ConfigurationErrorsException: Could not load file or assembly 'Microsoft.Extensions.DependencyInjection.Abstractions, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)]
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +767
System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +256
System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai) +58
System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +287
System.Web.Compilation.BuildManager.GetPreStartInitMethodsFromReferencedAssemblies() +69
System.Web.Compilation.BuildManager.CallPreStartInitMethods(String preStartInitListPath, Boolean& isRefAssemblyLoaded) +137
System.Web.Compilation.BuildManager.ExecutePreAppStart() +172
System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +854
[HttpException (0x80004005): Could not load file or assembly 'Microsoft.Extensions.DependencyInjection.Abstractions, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +532
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +111
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +724
Cause
DNN 9.4.0+ includes Microsoft.Extensions.DependencyInjection.Abstractions.dll v2.1.1 and Microsoft.Extensions.DependencyInjection.dll v2.1.1 as part of install and upgrade zip.
2sxc v13+ includes Microsoft.Extensions.DependencyInjection.Abstractions v2.2.0 and Microsoft.Extensions.DependencyInjection v2.2.0 as transient dependency in bin folder.
During dnn upgrade user unzip/copy older version of Microsoft.Extensions.DependencyInjection.Abstractions.dll v2.1.1 and Microsoft.Extensions.DependencyInjection.dll v2.1.1 in DNN bin folder.
On first run ASP.NET notice that binding redirect version of this assemblies in web.config is not the same as version of this dll files in bin folder and throws Server Error.
This is what's added to the web.config, DNN when installing 2sxc (assembly binding redirects)
Than open your DNN web site. Server Error should go away and user can finish DNN upgrade as usual.
Additional Information
DNN websites that have 2sxc v13.00-v13.03, after DNN Upgrade to DNN 9.4+ version will get server error Could not load file or assembly 'Microsoft.Extensions.DependencyInjection.Abstractions' or one of its dependencies.
To prevent this server error please install 2sxc v13.04+ before DNN Upgrade.
With 2sxc v13.04 our goal was to ensure that DNN upgrade do not break DNN installation.
The text was updated successfully, but these errors were encountered:
iJungleboy
changed the title
After DNN upgrade to latest DNN 9.10.2, server error "Could not load file or assembly 'Microsoft.Extensions.DependencyInjection.Abstractions' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)"
Solution for Server Error after DNN upgrade (Microsoft.Extensions.DependencyInjection.Abstractions)
Mar 16, 2022
This is a Guide to Fix a Problem after a Dnn Update
Problem
User is doing DNN upgrade to latest DNN 9.10.2 using upgrade zip.
Before upgrade, DNN installation is version 9.10.1 (or older) and it has 2sxc v13+ module installed.
After upgrade, on first run, there is Server Error.
Cause
Microsoft.Extensions.DependencyInjection.Abstractions.dll
v2.1.1 andMicrosoft.Extensions.DependencyInjection.dll
v2.1.1 as part of install and upgrade zip.Microsoft.Extensions.DependencyInjection.Abstractions
v2.2.0 andMicrosoft.Extensions.DependencyInjection v2.2.0
as transient dependency inbin
folder.Microsoft.Extensions.DependencyInjection.Abstractions.dll
v2.1.1 andMicrosoft.Extensions.DependencyInjection.dll
v2.1.1 in DNN bin folder.web.config
is not the same as version of this dll files inbin
folder and throws Server Error.This is what's added to the
web.config
, DNN when installing 2sxc (assembly binding redirects)Fix / Current workaround
From https://github.com/2sic/2sxc/releases/download/v13.03.00/2sic_2SexyContent_13.03.00_Install.zip user should unzip and copy dlls v2.2.0 to dnn's
bin
where are dll's v2.1.1.Than open your DNN web site. Server Error should go away and user can finish DNN upgrade as usual.
Additional Information
DNN websites that have 2sxc v13.00-v13.03, after DNN Upgrade to DNN 9.4+ version will get server error
Could not load file or assembly 'Microsoft.Extensions.DependencyInjection.Abstractions' or one of its dependencies.
To prevent this server error please install 2sxc v13.04+ before DNN Upgrade.
With 2sxc v13.04 our goal was to ensure that DNN upgrade do not break DNN installation.
The text was updated successfully, but these errors were encountered: