Skip to content

[BUG] Version downgrade in .NET 6 for Microsoft.VisualBasic.Core.dll leads to broken Microsoft Installers #62218

Closed
@czdietrich

Description

@czdietrich

Describe the bug

From .NET 5 to .NET 6 the version schema of Microsoft.VisualBasic.Core.dll has changed and is now lower than before. When an application is compiled as self-contained and bundled into an MSI file, upgrading from a previous (e.g. .NET 5) version will lead to an issue in the Microsoft Installer installation process.

To Reproduce

  1. Create a new application (e.g. dotnet new console -f net5.0)
  2. Create global.json (e.g. dotnet new globaljson --sdk-version 5.0.100)
  3. Publish the app as self-contained application (e.g. dotnet publish -c Release --self-contained true -r win-x64)
  4. Bundle the application as MSI file (e.g. use WiX toolset or skip this step for now)
  5. Repeat steps 1 to 4 for .NET 6.0 (-f net6.0 and --sdk-version 6.0.100)

In case you created MSI files:

Install the MSI from the first run and then upgrade the installation using the MSI from the second run.
Inspect the installation directory: Microsoft.VisualBasic.Core.dll is missing.
If you repeat this but you do a fresh installation of the second run, Microsoft.VisualBasic.Core.dll would be correctly placed in the installation folder.
In the end this means upgrading or fresh installing will lead to different results.

In case you did not build MSI files:

Inspect Publish-folder of both dotnet publish-runs. You will see that Microsoft.VisualBasic.Core.dll has a higher file version number for .NET 5 build than for the .NET 6 build.
image

Further technical details

It is important that the file version of a DLL does not downgrade for a newer installer compared to the currently installed DLLs.
More info about this can be found here:
https://stackoverflow.com/questions/47157021/downgraded-ms-dll-disappears-on-upgrade-windows-installer
https://docs.microsoft.com/de-de/archive/blogs/astebner/why-windows-installer-removes-files-during-a-major-upgrade-if-they-go-backwards-in-version-numbers
https://docs.microsoft.com/en-us/windows/win32/msi/both-files-have-a-version

Question

What is the expected and recommended way to handle this problem?

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions