Skip to content

Empty .Net Core Runtime install folder is enough to break applications. #126716

@schleich-ssc

Description

@schleich-ssc

Description

I just recreated the bug report as the old one was locked.
Old one is found here:
#91806

Latest comment in the bug-report was related to the upcoming release in November 2023:
After some more evaluation of the impact and risk, we are backporting this to .NET 6 (and 7). We missed the deadline for October, but the fix should be in the November release.
But the Bug was not fixed in .NetCore 6+7

  • A group of applications are built to run against .Net 6.
  • A tester or user uninstalls the .Net Runtime for whatever reason, in this example assume .Net v6.0.36.
  • Later, when our applications are installed, the .Net 6 Runtime is reinstalled, in this example assume .Net v6.0.9.
  • Our applications fail to execute.
  • Event Viewer shows this error: "...required to execute the application was not found in 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\6.0.35"
  • We then notice that an empty "6.0.35" folder exists while the full Runtime is available in a "6.0.9" folder.
  • If we delete the 6.0.35 the issue is fixed.

Reproduction Steps

Empty Folders seem to be created when new versions of the runtime are installed and replace the older version.
In our case when we just uninstalled version 6.0.36 this automatically removed the appropriate directory 6.0.36.
But the previous one (6.0.35) was kept.

you can manually replicate the problem by simply creating an empty folder in
C:\Program Files\dotnet\shared\Microsoft.NETCore.App\6.0.xx
where xx has to be the highest version installed.

Expected behavior

When faced with an empty .Net Core folder, the application should look for another version of the runtime which meets it's requirements.

Actual behavior

All .Net Core applications targeting the Runtime (major.minor) will fail to execute.

Regression?

This issue was mentioned to be fixed also in NetCore6+7

Known Workarounds

  • Delete the folder, but that is not a solution for the field.
  • Have our installers detect that situation and fix it. Not ideal.

Configuration

  • We are using .Net 6
  • Windows 10 & 11
  • Mostly x64

Other information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-Hostneeds-author-actionAn issue or pull request that requires more info or actions from the author.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status

    No status

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions