Skip to content

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

Closed

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?

Activity

  1. marcpopMSFT commented on Nov 29, 2021

    @marcpopMSFT
    Member

    @jaredpar Who can look into the versioning of Microsoft.VisualBasic.Core.dll? It looks like it switched to be runtime versioned from some prior versioning mechanism.

  2. jaredpar commented on Nov 30, 2021

    @jaredpar
    Member
  3. ericstj commented on Nov 30, 2021

    @ericstj
    Member

    Let's move to dotnet/runtime. This appears to have regressed here: a505c46#diff-804ceb4a1df769aca14d1bd4043455cc1cce391376dcb02798cbf716cc6150eeL4

    This should be fixed, including in servicing.

  4. transferred this issue fromdotnet/sdkon Nov 30, 2021
  5. ghost added
    untriaged
    on Nov 30, 2021
  6. ericstj commented on Nov 30, 2021

    @ericstj
    Member

    We need to restore the MajorVersion property. That's no longer being set, causing the assembly to get default file version.

  7. added this to the 6.0.x milestone on Nov 30, 2021
  8. removed
    untriaged
    on Nov 30, 2021
  9. self-assigned this
    on Nov 30, 2021
  10. safern commented on Nov 30, 2021

    @safern
    Member

    I'll tackle this one for the next servicing release.

  11. czdietrich commented on Dec 9, 2021

    @czdietrich
    Author

    Any news on this? Is it still on track for the next servicing release? This is kind of a blocker for us.

    Thanks, Michael.

  12. safern commented on Dec 9, 2021

    @safern
    Member

    Hello, @czdietrich, yes it will be fixed as part of the next servicing release.

  13. ghost added
    in-pr
    on Dec 16, 2021
  14. ghost removed
    in-pr
    on Dec 16, 2021
  15. ViktorHofer commented on May 6, 2022

    @ViktorHofer
    Member

    This got fixed with #62908.

  16. ghost locked as resolved and limited conversation to collaborators on Jun 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions