Uninstalling older dotnet versions

Shiraz Jauffer 20 Reputation points
2024-12-03T13:44:52.1966667+00:00

Hi, I am running a vulnerability scan on one of our servers which is running Microsoft .NET version 8.0.8. The scan is reporting a vulnerability with this version so I installed version 8.0.11. However, when I run dotnet --info command, the output shows that I have 8.0.8 and 8.0.11 installed. I tried using the dotnet-core-uninstall' tool but that does not list 8.0.8 installed. Therefore, this still shows up as a vulnerability. How do I remove the 8.0.8 version?

C:\Program Files (x86)\dotnet-core-uninstall>dotnet --info

.NET SDK:

Version: 8.0.401

Commit: 811edcc344

Workload version: 8.0.400-manifests.b6724b7a

MSBuild version: 17.11.4+37eb419ad

Runtime Environment:

OS Name: Windows

OS Version: 10.0.17763

OS Platform: Windows

RID: win-x64

Base Path: C:\Program Files\dotnet\sdk\8.0.401\

.NET workloads installed:

Configured to use loose manifests when installing new manifests.

There are no installed workloads to display.

Host:

Version: 8.0.11

Architecture: x64

Commit: 9cb3b725e3

.NET SDKs installed:

8.0.401 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:

Microsoft.AspNetCore.App 8.0.8 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]

Microsoft.AspNetCore.App 8.0.11 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]

Microsoft.NETCore.App 8.0.8 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]

Microsoft.NETCore.App 8.0.11 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]

Microsoft.WindowsDesktop.App 8.0.8 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Microsoft.WindowsDesktop.App 8.0.11 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Thanks

Shiraz

Developer technologies ASP.NET ASP.NET Core
Developer technologies .NET Other
Developer technologies ASP.NET Other
0 comments No comments
{count} votes

Accepted answer
  1. Jiachen Li-MSFT 34,221 Reputation points Microsoft External Staff
    2024-12-03T14:34:07.1566667+00:00

    Hi @Shiraz Jauffer ,

    First try uninstalling the unwanted NET runtime in the Uninstall or Change program in the Control Panel。

    If it not listed, you can manually remove them.

    • Open File Explorer and go to:
      • C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App
      • C:\Program Files\dotnet\shared\Microsoft.NETCore.App
      • C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App
    • In each of these directories, locate the folder named 8.0.8 and delete it.
    • Run dotnet --info again to ensure the 8.0.8 runtime is no longer listed.

    Best Regards.

    Jiachen Li


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. AgaveJoe 30,126 Reputation points
    2024-12-03T14:30:20.65+00:00

    It looks like you have the SDKs installed on the server. The Window's add/remove programs works well for removing SDKs and runtimes.

    Otherwise, the dotnet-core-uninstall list command lists the SDKs that can be removed using the Uninstall Tool.

    Reference documentation.

    https://learn.microsoft.com/en-us/dotnet/core/install/remove-runtime-sdk-versions?pivots=os-windows

    https://learn.microsoft.com/en-us/dotnet/core/additional-tools/uninstall-tool-overview?pivots=os-windows


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.