dotnet / core

.NET news, announcements, release notes, and more!
https://dot.net
MIT License
20.89k stars 4.89k forks source link

Windows update keeps install .NET Runtime & SDK even I deleted them #6069

Open fuchanghao opened 3 years ago

fuchanghao commented 3 years ago

Description

I already switched to .NET 5 with Visual Studio 16.9.

But windows update still installs the .NET Core 2 runtimes also the old .NET 5 SDK 5.0.104.

6rnDbT.png

if I delete them, windows update will re-install them when I check for updates.

6rnsVU.png

I don't want to disable Microsoft updates because I want it to update my desktop runtimes.

Configuration

System: Windows 10 20H2 x64 Enterprise. (19042.867)

mairaw commented 3 years ago

This is how Microsoft Update (MU) works at the moment. More details at https://devblogs.microsoft.com/dotnet/net-core-updates-coming-to-microsoft-update/

Tagging @jamshedd to see if there are any plans on changing this for MU.

jamshedd commented 3 years ago

.NET Core updates are offered via MU only if you have a previous patch for the same Core version already installed. Make sure you remove all 2.1 versions from Add-Remove Programs and also remove the 2.1 components in Visual Studio, after that MU will not offer 2.1 updates. The most likely explanation is you have .NET Core 2.1 installed through Visual Studio.

fuchanghao commented 3 years ago

.NET Core updates are offered via MU only if you have a previous patch for the same Core version already installed. Make sure you remove all 2.1 versions from Add-Remove Programs and also remove the 2.1 components in Visual Studio, after that MU will not offer 2.1 updates. The most likely explanation is you have .NET Core 2.1 installed through Visual Studio.

I'm sure I don't have .NET Core 2.1 installed.

6s0ZAe.png

Maybe the reason of the problem?

After I updated to visual studio to 16.9 which seems I switched to ".NET 5 SDK v5.0.201"

But I found that there's still folder "C:\Program Files\dotnet\sdk\5.0.103" with many files in it.

So the old .NET 5 SDK doesn't fully removed while update?

jamshedd commented 3 years ago

Sorry I thought the issue was about .NET Core 2.1 being left behind, I now realize you're talking about .NET 5.0.103 being left behind when .NET 5.0.201 is installed. This is by design - the 103 and 201 SDKs are different "bands" and the 201 SDK does not update the 103 band, it installs side by side. If you do not want the 103 band you can remove it from Add-Remove Programs and as long as VS has also been updated to at least 16.9 it should not come back.

fuchanghao commented 3 years ago

Sorry I thought the issue was about .NET Core 2.1 being left behind, I now realize you're talking about .NET 5.0.103 being left behind when .NET 5.0.201 is installed. This is by design - the 103 and 201 SDKs are different "bands" and the 201 SDK does not update the 103 band, it installs side by side. If you do not want the 103 band you can remove it from Add-Remove Programs and as long as VS has also been updated to at least 16.9 it should not come back.

I have removed those files but seems it still not work.

Checked with dotnet command there's what I have installed.

66kk8I.png

jamshedd commented 3 years ago

Sorry it is not clear to me what is not working. The screenshot shows you no longer have 5.0.103 installed or any version of .NET Core 2.1 installed after you uninstalled, which looks as expected to me. Could you elaborate on what you expect to see instead?

teo-tsirpanis commented 3 years ago

If you do not want the 103 band you can remove it from Add-Remove Programs and as long as VS has also been updated to at least 16.9 it should not come back.

@jamshedd yesterday, after this month's update, I realized that the 5.0.2xx and 3.1.1xx installations on my machine are redundant and uninstalled them, but today Windows Update decided to bring them back. FWIW on my machine there is also Visual Studio Enterprise 2019 16.11.3, and Visual Studio 2022 Preview 4.

jamshedd commented 3 years ago

@teo-tsirpanis, would you be up for trying this again? Remove the old/redundant versions you don't want, reboot, and then share with me the output of:

dotnet.exe --list-runtimes dotnet.exe --list-sdks

Then do a scan on Microsoft Update (Check for Updates), install whatever is offered, and then run the above commands again.

teo-tsirpanis commented 3 years ago

ΟΚ, this is my list after the removal:

dotnet --list-sdks
3.1.413 [C:\Program Files\dotnet\sdk]
5.0.401 [C:\Program Files\dotnet\sdk]
6.0.100-preview.7.21379.14 [C:\Program Files\dotnet\sdk]
6.0.100-rc.1.21458.32 [C:\Program Files\dotnet\sdk]
dotnet --list-runtimes
Microsoft.AspNetCore.App 3.1.19 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 5.0.10 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 6.0.0-preview.7.21378.6 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 6.0.0-rc.1.21452.15 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 3.1.19 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 5.0.10 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.0-preview.7.21377.19 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.0-rc.1.21451.13 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 3.1.19 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 5.0.10 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 6.0.0-preview.7.21378.9 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 6.0.0-rc.1.21451.3 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

I will reboot my machine, run WU and update this message soon. Still, WU installed them again after a reboot:

image image image

The result of dotnet --list-runtimes hasn't changed, but dotnet --list-sdks added 3.1.119 and 5.0.207.

jamshedd commented 3 years ago

Do you have VS also installed on this machine? If so can you tell me what versions of VS (including update levels) are installed?

teo-tsirpanis commented 3 years ago

There are Visual Studio Enterprise 2019 16.11.3, and Visual Studio 2022 Preview 4.

patlevin commented 2 years ago

I have have the same problem as @teo-tsirpanis - WU keeps installing .NET Core 2.1 and 3.1. None of those SDKs are installed with Visual Studio (v16.11.4).

jespersh commented 2 years ago

It also seems when WSUS is behind the herd then it starts providing failed updates:

image And another 11 off screen

dotnet --info
.NET SDK (reflecting any global.json):
 Version:   6.0.100-rc.2.21505.57
 Commit:    ab39070116

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.19043
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:\Program Files\dotnet\sdk\6.0.100-rc.2.21505.57\

Host (useful for support):
  Version: 6.0.0-rc.2.21480.5
  Commit:  6b11d64e7e

.NET SDKs installed:
  3.1.414 [C:\Program Files\dotnet\sdk]
  5.0.104 [C:\Program Files\dotnet\sdk]
  5.0.201 [C:\Program Files\dotnet\sdk]
  5.0.203 [C:\Program Files\dotnet\sdk]
  5.0.208 [C:\Program Files\dotnet\sdk]
  5.0.303 [C:\Program Files\dotnet\sdk]
  5.0.402 [C:\Program Files\dotnet\sdk]
  6.0.100-rc.2.21505.57 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.All 2.1.30 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.App 2.1.30 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 3.1.13 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 3.1.20 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 5.0.4 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 5.0.9 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 5.0.11 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.0-rc.2.21480.10 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 2.1.26 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.1.30 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 3.1.13 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 3.1.20 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 5.0.4 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 5.0.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 5.0.11 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.0-rc.2.21480.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.WindowsDesktop.App 3.1.13 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 3.1.20 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 5.0.4 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 5.0.9 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 5.0.11 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 6.0.0-rc.2.21501.6 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

To install additional .NET runtimes or SDKs:
  https://aka.ms/dotnet-download
vjraitila commented 2 years ago

I have the same problem. I only have runtimes for .NET Core 3 and 6 installed. I also removed all traces of Visual Studio.

PS C:\Program Files\dotnet> dotnet --info

Host (useful for support):
  Version: 6.0.2
  Commit:  839cdfb0ec

.NET SDKs installed:
  No SDKs were found.

.NET runtimes installed:
  Microsoft.NETCore.App 3.1.23 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.2 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.WindowsDesktop.App 3.1.23 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 6.0.2 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Windows Update is still forcing an unsupported .NET Core 2 (+ corresponding ASP.NET Core) runtime on my machine through the following update:

2021-08 .NET Core 2.1.30 Security Update for x64 Client (KB5005418)

How can I troubleshoot this? What makes WU think said update should be applied?

Falco20019 commented 1 year ago

We have the same problem. I uninstalled .NET Core 2.1 and ASP.NET Core 5.0 completely due to them being EOL. But as soon as I check for Windows Update, it's reinstalling them...

Before Windows Update check:

$> dotnet --info
.NET SDK:
 Version:   7.0.203
 Commit:    5b005c19f5

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.14393
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:\Program Files\dotnet\sdk\7.0.203\

Host:
  Version:      7.0.5
  Architecture: x64
  Commit:       8042d61b17

.NET SDKs installed:
  6.0.116 [C:\Program Files\dotnet\sdk]
  7.0.203 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 6.0.16 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 7.0.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 6.0.16 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 7.0.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.WindowsDesktop.App 6.0.16 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 7.0.5 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Other architectures found:
  x86   [C:\Program Files (x86)\dotnet]
    registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]

Environment variables:
  Not set

global.json file:
  Not found

Learn more:
  https://aka.ms/dotnet/info

Download .NET:
  https://aka.ms/dotnet/download

After Windows update check:

$> dotnet --info
.NET SDK:
 Version:   7.0.203
 Commit:    5b005c19f5

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.14393
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:\Program Files\dotnet\sdk\7.0.203\

Host:
  Version:      7.0.5
  Architecture: x64
  Commit:       8042d61b17

.NET SDKs installed:
  6.0.116 [C:\Program Files\dotnet\sdk]
  7.0.203 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 5.0.16 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.16 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 7.0.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 2.1.30 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.16 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 7.0.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.WindowsDesktop.App 6.0.16 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 7.0.5 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Other architectures found:
  x86   [C:\Program Files (x86)\dotnet]
    registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]

Environment variables:
  Not set

global.json file:
  Not found

Learn more:
  https://aka.ms/dotnet/info

Download .NET:
  https://aka.ms/dotnet/download

I used https://www.mcbsys.com/blog/2015/11/uninstall-and-hide-windows-updates/ to hide 5005418 and 5013354 and hope it's at least resolved for now.

I also needed to hide all other superseeded ones by adjusting the script accordingly: image

The main issue seems to be, that even after the software is uninstalled, the Windows Update cache is keeping all prior know updates in the cache. All of these had been marked as IsInstalled=0, so maybe it also an issue with the check of MU.

jamshedd commented 1 year ago

Adding @joeloff and @csnellgrove1-zz

joeloff commented 1 year ago

If it's marked as not installed, the applicability logic may think it's installable. Updates for 2.1 and 3.1 (and 5.0) were based on a sequence of MSI detection logic. This meant that if you had Visual Studio installed, MU might bring in a full standalone SDK if it runs before VS is updated. Recently in 6.0 and 7.0 we changed the logic to only offer for standalone installs, so .NET copies installed by VS won't be updated through MU.

It's possible some of the MSIs used for detection remains installed and is triggering the updates to offer. Can you try running the following: REG QUERY HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall /f ".NET CORE" /s?

Falco20019 commented 1 year ago

Apps & features: image

Registry:

$> REG QUERY HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall /f ".NET CORE" /s

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{0DF7C481-9E91-3118-B877-6EA9084358AD}
    DisplayName    REG_SZ    Microsoft ASP.NET Core 6.0.16 Shared Framework (x64)

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{135A25E2-920D-3A18-A1A2-C18B7D3ADD48}
    DisplayName    REG_SZ    Microsoft ASP.NET Core 7.0.5 Targeting Pack (x64)

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{205F7C26-9D58-3238-92AB-3E63B67273D5}
    DisplayName    REG_SZ    Microsoft ASP.NET Core 3.1.10 Targeting Pack (x64)

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{495CF57C-C5FD-45CA-8FCE-071B57294E59}
    DisplayName    REG_SZ    Microsoft .NET Core AppHost Pack - 3.1.13 (x64_x86)

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{4AF988BF-C81F-49C4-A30A-DB2F19AD5C1D}
    DisplayName    REG_SZ    Microsoft .NET Core AppHost Pack - 3.1.13 (x64_arm)

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{4CFF18E0-1998-37CA-AAE3-F849BFF084F5}
    DisplayName    REG_SZ    Microsoft ASP.NET Core 5.0.4 Shared Framework (x64)

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{50C9A496-C5D4-4001-BD7C-8560D20971DB}
    DisplayName    REG_SZ    Microsoft .NET Core AppHost Pack - 3.1.13 (x64)

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{754209E2-05C7-35ED-A0D4-22766E52AF0F}
    DisplayName    REG_SZ    Microsoft ASP.NET Core 6.0.16 Targeting Pack (x64)

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{BBCA3D09-1C67-4146-83D6-6C7ED6600CCF}
    DisplayName    REG_SZ    Microsoft .NET Core AppHost Pack - 3.1.13 (x64_arm64)

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{D308E21A-12AC-4FA1-81E8-FB4EB5D0ABF8}
    DisplayName    REG_SZ    Microsoft .NET Core Runtime - 2.1.26 (x64)

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{D4659401-47DD-3355-A866-C827D0DDAC97}
    DisplayName    REG_SZ    Microsoft ASP.NET Core 7.0.5 Shared Framework (x64)

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{E0CA9FE6-E4C6-3A2D-BEE0-F51481757E34}
    DisplayName    REG_SZ    Microsoft ASP.NET Core 3.1.13 Shared Framework (x64)

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{EEC5DD9E-587D-4360-868B-CB5A752A6BD0}
    DisplayName    REG_SZ    Microsoft .NET Core Runtime - 3.1.13 (x64)

End of search: 13 match(es) found.

I will try and manually uninstall all of them using MsiExec.exe /X{...}.

Falco20019 commented 1 year ago

I did some more searches. While the first one only finds .NET Standard 2.1 (which is OK), the second one found some more .NET 5 stuff that I'm also going to delete.

$> REG QUERY HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall /f ".NET*- 2" /s

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{A7036CFB-B403-4598-85FF-D397ABB88173}
    DisplayName    REG_SZ    Microsoft .NET Standard Targeting Pack - 2.1.0 (x64)

End of search: 1 match(es) found.

$> REG QUERY HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall /f ".NET*- 5" /s

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{06EBD892-2541-498C-8E78-BCB7E9596589}
    DisplayName    REG_SZ    Microsoft .NET AppHost Pack - 5.0.4 (x64)

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{16E242C4-24A9-4381-8023-0F246750CA47}
    DisplayName    REG_SZ    Microsoft .NET Runtime - 5.0.16 (x64)

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{28BB0210-B7E3-4128-8EA9-9ED79E2D0B34}
    DisplayName    REG_SZ    Microsoft .NET AppHost Pack - 5.0.4 (x64_x86)

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{29CBA832-8D09-42D0-82F4-3583EE247A5E}
    DisplayName    REG_SZ    Microsoft .NET Host FX Resolver - 5.0.16 (x64)

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{4FB34C2A-BAD1-4E64-8DFB-6568EFFA8B4B}
    DisplayName    REG_SZ    Microsoft .NET AppHost Pack - 5.0.4 (x64_arm)

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{678F8AE2-7E5F-4392-9B6D-AED8326FB2AF}
    DisplayName    REG_SZ    Microsoft .NET Targeting Pack - 5.0.0 (x64)

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{773EF543-570F-4746-953A-3CB19DFCB3E2}
    DisplayName    REG_SZ    Microsoft .NET Host FX Resolver - 5.0.4 (x64)

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{879C9645-ADF3-4697-915B-00B76EBA629F}
    DisplayName    REG_SZ    Microsoft .NET Runtime - 5.0.4 (x64)

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{D9C5ED51-E728-4C16-8176-DE2D2A5E1221}
    DisplayName    REG_SZ    Microsoft .NET AppHost Pack - 5.0.4 (x64_arm64)

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{DD901386-A294-4FF1-A683-0EFF5C66209A}
    DisplayName    REG_SZ    Microsoft .NET Host - 5.0.4 (x64)

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{E663ED1E-899C-40E8-91D0-8D37B95E3C69}
    DisplayName    REG_SZ    Microsoft .NET Host - 5.0.17 (x64)

End of search: 11 match(es) found.
joeloff commented 1 year ago

Not that if these were installed through VS, they may have a lingering dependency that will block removal through msiexec. You can confirm this by looking at HKLM\SOFTWARE\Classes\Installer\Dependencies. You can use the product code GUIDs from the previous search to locate the entries. If there are VS dependencies, you'll see something similar to this

image

When you run msiexec, you can try msiexec /x {guid} IGNOREDEPENDENCIES=ALL

Falco20019 commented 1 year ago

It seems that his is not the only source. It got reinstalled again. Before and after are no mentions, the folder was recreated yesterday after the weekly Windows Update. It was also not available before in the Apps & Features.

$>REG QUERY HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall /f "*.NET* 5" /s

End of search: 0 match(es) found.^

$>REG QUERY HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall /f ".NET CORE" /s

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{4A7B2666-1A77-32D8-BB54-CCC1A1B3FE85}
    DisplayName    REG_SZ    Microsoft ASP.NET Core 7.0.10 Targeting Pack (x64)

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{5DD0FE97-EC10-3757-9722-4A321BC78D68}
    DisplayName    REG_SZ    Microsoft ASP.NET Core 6.0.21 Targeting Pack (x64)

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{5FC405D7-181B-37E7-B9BF-431A0D89592E}
    DisplayName    REG_SZ    Microsoft ASP.NET Core 6.0.18 Shared Framework (x64)

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{BD598123-CBAE-3720-8A79-3F68EA7A3A16}
    DisplayName    REG_SZ    Microsoft ASP.NET Core 6.0.21 Shared Framework (x64)

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{CFC1D234-85D8-37E7-8A6C-556FB9307F6D}
    DisplayName    REG_SZ    Microsoft ASP.NET Core 7.0.10 Shared Framework (x64)

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{ECF19E74-74A7-307F-8A58-A767C849E0B0}
    DisplayName    REG_SZ    Microsoft ASP.NET Core 6.0.18 Targeting Pack (x64)

End of search: 6 match(es) found.

image image

Falco20019 commented 1 year ago

I did find an old ASP.NET Core 5.0.4 with REG QUERY HKLM\SOFTWARE\Classes\Installer\Products /f ".NET CORE" /s which was not uninstallable for obvious reasons. I reinstalled it through the MSI given there and after that the UninstallString also worked again. Hope it's fully gone now.