Skip to content

[BUG] Version downgrade in .NET 7 for System.IO.Compression.Native.dll leads to broken Microsoft Installers #82518

Closed as not planned
@czdietrich

Description

@czdietrich

Description

From .NET 6 to .NET 7 the version schema of System.IO.Compression.Native.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 6) version will lead to an issue in the Microsoft Installer installation process.

Reproduction Steps

  1. Create a new application (e.g. dotnet new console -f net6.0)
  2. Create a global.json (e.g. dotnet new globaljson --sdk-version 6.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 7.0 (-f net7.0 and --sdk-version 7.0.100)

Expected behavior

The latest DLLs for .NET self contained builds will be deployed when installing using MSI if there is a previous installation using .NET 6.

Actual behavior

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: System.IO.Compression.Native.dll is missing.
If you repeat this but you do a fresh installation of the second run, System.IO.Compression.Native.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 System.IO.Compression.Native.dll has a higher file version number for .NET 6 build than for the .NET 7 build.
image

Regression?

A similar issue existed in .NET 6 and got fixed. Maybe there could be some test checking for these kind of version conflicts to prevent this class of issues in the future?

Known Workarounds

No response

Configuration

No response

Other information

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions