Is there an existing issue for this?
What happened?
This is a continuation of #7510. That issue was addressed by PR #7512, but the same problem is still reproducible with a clean DNN 10.4.0 RC2 installation.
First, many thanks to @donker and the DNN TAG team for the exciting new installation and upgrade process.
This is a significant improvement toward eliminating one of the most frustrating types of DNN installation and upgrade failures: an extension package overwriting newer assemblies already installed by DNN and leaving the website unable to start.
Unfortunately, the problem reported in #7510 still occurs with:
- Clean installation of DNN Platform 10.4.0 RC2
- Clean installation of 2sxc 22.00.00 through the DNN Extensions UI
The 2sxc installation completes without visible errors, and its installation log appears successful. However, after reloading the website, DNN can no longer start and displays:
Could not load type 'Microsoft.Extensions.Logging.ILoggingBuilder'
from assembly 'Microsoft.Extensions.Logging.Abstractions,
Version=2.2.0.0, Culture=neutral,
PublicKeyToken=adb9793829ddae60'.
Comparing the DNN bin directory before and after installing 2sxc shows that several assemblies supplied by DNN 10.4.0 RC2 were replaced by older versions from the extension package. Corresponding binding redirects were also changed to the older deployed versions.
The RC2 protection added by PR #7512 does not appear to run through the step-based clean-install path, so the DNN assemblies are not registered early enough to protect them during subsequent extension installations.
Steps to reproduce?
- Perform a clean installation using
DNN_Platform_10.4.0-rc.2_Install.zip.
- Confirm that the new DNN website starts and operates normally.
- Open the DNN Extensions UI.
- Install
ToSic.Sxc.Dnn.22.00.00_Install.zip.
- Observe that the extension installation completes without reporting an error.
- Reload the website.
- Observe that DNN fails during startup with the
ILoggingBuilder type-load exception.
- Compare the
bin directory and web.config before and after installing 2sxc.
Current Behavior
The extension installer replaces newer DNN assemblies with older copies from the extension package.
The following assembly-version changes were observed:
| Assembly |
Clean DNN 10.4 RC2 |
After 2sxc 22 installation |
Microsoft.Extensions.Configuration.Abstractions.dll |
10.0.0.12 |
2.2.0.0 |
Microsoft.Extensions.Configuration.Binder.dll |
10.0.0.0 |
2.1.1.0 |
Microsoft.Extensions.Configuration.dll |
10.0.0.12 |
2.1.1.0 |
Microsoft.Extensions.FileProviders.Abstractions.dll |
10.0.0.12 |
2.2.0.0 |
Microsoft.Extensions.Logging.Abstractions.dll |
10.0.0.12 |
2.2.0.0 |
Microsoft.Extensions.Logging.dll |
10.0.0.12 |
2.1.1.0 |
Microsoft.Extensions.Options.dll |
10.0.0.12 |
2.1.1.0 |
Microsoft.Extensions.Primitives.dll |
10.0.0.12 |
2.2.0.0 |
System.Diagnostics.DiagnosticSource.dll |
10.0.0.12 |
9.0.0.11 |
System.IO.Pipelines.dll |
10.0.0.12 |
9.0.0.0 |
System.Text.Json.dll |
10.0.0.12 |
9.0.0.0 |
This leaves DNN with an incompatible mixture of assemblies and prevents the application from starting.
Expected Behavior
Before installing any extension package, DNN should ensure that the assemblies already present in its bin directory are registered in the Assemblies database table with their current versions.
The extension installer should then:
- Preserve a newer assembly already supplied by DNN.
- Prevent an extension package from replacing it with an older version.
- Preserve or generate binding redirects compatible with the retained assembly.
- Complete the extension installation without leaving DNN in an unusable state.
Relevant log output
System.TypeLoadException: Could not load type
'Microsoft.Extensions.Logging.ILoggingBuilder' from assembly
'Microsoft.Extensions.Logging.Abstractions, Version=2.2.0.0,
Culture=neutral, PublicKeyToken=adb9793829ddae60'.
Anything else?
Info
PR #7512 added Upgrade.EnsureAssembliesRegistered() calls to the legacy Upgrade.InstallDNN and Upgrade.UpgradeDNN paths.
However, the new installation and upgrade wizards install extension packages through:
DotNetNuke.Services.Upgrade.InternalController.Steps.InstallExtensionsStep
In the DNN 10.4.0 RC2 source, InstallExtensionsStep.Execute() starts by calling Upgrade.GetInstallPackages() and then Upgrade.InstallPackage(). It does not call EnsureAssembliesRegistered().
Both the new InstallWizard and UpgradeWizard use this step.
Consequently, a clean installation can finish without registering the assemblies already present in bin. When 2sxc is installed later through the Extensions UI, the installer does not have the registered DNN assembly versions needed to prevent the downgrade.
Suggestion
Register the existing bin assemblies at the beginning of the step-based extension installation:
public override void Execute()
{
Upgrade.EnsureAssembliesRegistered();
var packages = Upgrade.GetInstallPackages();
// Existing implementation...
}
The possible implementation can:
- Make the existing
Upgrade.EnsureAssembliesRegistered() method accessible internally.
- Call it at the beginning of
InstallExtensionsStep.Execute(), before discovering or installing extension packages.
Affected Versions
develop build (unreleased)
What browsers are you seeing the problem on?
No response
Code of Conduct
Is there an existing issue for this?
What happened?
This is a continuation of #7510. That issue was addressed by PR #7512, but the same problem is still reproducible with a clean DNN 10.4.0 RC2 installation.
First, many thanks to @donker and the DNN TAG team for the exciting new installation and upgrade process.
This is a significant improvement toward eliminating one of the most frustrating types of DNN installation and upgrade failures: an extension package overwriting newer assemblies already installed by DNN and leaving the website unable to start.
Unfortunately, the problem reported in #7510 still occurs with:
The 2sxc installation completes without visible errors, and its installation log appears successful. However, after reloading the website, DNN can no longer start and displays:
Comparing the DNN
bindirectory before and after installing 2sxc shows that several assemblies supplied by DNN 10.4.0 RC2 were replaced by older versions from the extension package. Corresponding binding redirects were also changed to the older deployed versions.The RC2 protection added by PR #7512 does not appear to run through the step-based clean-install path, so the DNN assemblies are not registered early enough to protect them during subsequent extension installations.
Steps to reproduce?
DNN_Platform_10.4.0-rc.2_Install.zip.ToSic.Sxc.Dnn.22.00.00_Install.zip.ILoggingBuildertype-load exception.bindirectory andweb.configbefore and after installing 2sxc.Current Behavior
The extension installer replaces newer DNN assemblies with older copies from the extension package.
The following assembly-version changes were observed:
Microsoft.Extensions.Configuration.Abstractions.dllMicrosoft.Extensions.Configuration.Binder.dllMicrosoft.Extensions.Configuration.dllMicrosoft.Extensions.FileProviders.Abstractions.dllMicrosoft.Extensions.Logging.Abstractions.dllMicrosoft.Extensions.Logging.dllMicrosoft.Extensions.Options.dllMicrosoft.Extensions.Primitives.dllSystem.Diagnostics.DiagnosticSource.dllSystem.IO.Pipelines.dllSystem.Text.Json.dllThis leaves DNN with an incompatible mixture of assemblies and prevents the application from starting.
Expected Behavior
Before installing any extension package, DNN should ensure that the assemblies already present in its
bindirectory are registered in theAssembliesdatabase table with their current versions.The extension installer should then:
Relevant log output
Anything else?
Info
PR #7512 added
Upgrade.EnsureAssembliesRegistered()calls to the legacyUpgrade.InstallDNNandUpgrade.UpgradeDNNpaths.However, the new installation and upgrade wizards install extension packages through:
In the DNN 10.4.0 RC2 source,
InstallExtensionsStep.Execute()starts by callingUpgrade.GetInstallPackages()and thenUpgrade.InstallPackage(). It does not callEnsureAssembliesRegistered().Both the new
InstallWizardandUpgradeWizarduse this step.Consequently, a clean installation can finish without registering the assemblies already present in
bin. When 2sxc is installed later through the Extensions UI, the installer does not have the registered DNN assembly versions needed to prevent the downgrade.Suggestion
Register the existing
binassemblies at the beginning of the step-based extension installation:The possible implementation can:
Upgrade.EnsureAssembliesRegistered()method accessible internally.InstallExtensionsStep.Execute(), before discovering or installing extension packages.Affected Versions
develop build (unreleased)
What browsers are you seeing the problem on?
No response
Code of Conduct