Announcing the .NET Core Uninstall Tool 1.0!

Sarah Oslund

Today we are releasing the .NET Core Uninstall Tool for Windows and Mac!

Starting in Visual Studio 2019 version 16.3, Visual Studio manages the versions of the SDK and runtime it installs. In previous versions, SDKs and runtimes were left on upgrade in case those versions were targeted or pinned with global.json. We realized this was not ideal and might have left many unused .NET Core SDKs and runtimes installed on your machine.

Going forward, we’ve updated the Visual Studio behavior. The .NET Core standalone SDK installer also began removing previous patch versions (the last two digits, for example 3.1.1xx) in .NET Core 3.0. If you want a version of the SDK or runtime that was removed during an update, reinstall it from the .NET Core archive. SDKs and runtimes installed with the standalone installers (such as from the .NET archive) are not removed by Visual Studio.

We are releasing the .NET Core Uninstall Tool to help you get your machine into a more manageable state AND save you some disk space!

If you’d like to see what versions of .NET Core SDKs or runtimes are available on your machine, type dotnet --list-sdks or dotnet --list-runtimes, respectively:

$ dotnet --list-sdks 

3.1.200-preview-014971 [C:\Program Files\dotnet\sdk] 

$ dotnet --list-runtimes 

Microsoft.AspNetCore.All 2.1.15 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] 
Microsoft.AspNetCore.App 2.1.15 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] 
Microsoft.AspNetCore.App 3.1.1 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] 
Microsoft.NETCore.App 2.1.15 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] 
Microsoft.NETCore.App 3.1.1 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] 
Microsoft.WindowsDesktop.App 3.1.1 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] 

If the list is short, you can uninstall them using Add or Remove Programs. If uninstalling via that dialog appears tedious, you can download and use the .NET Core Uninstall Tool! For specific commands and detailed instructions, see the .NET Core Uninstall Tool article.

This is a powerful tool and it’s easy to make a mistake. But don’t worry… you can always either run a repair on Visual Studio or reinstall from the .NET Core archive.

Because this tool is based on installers, it works only on Windows and Mac and not on Linux.

Hope this helps!

11 comments

Comments are closed.

  • Avatar
    Michael Taylor

    I literally could have used this last week as I ran through the 30+ versions installed and removed most of them one by one.

    Hopefully the tool provides an easy way to uninstall all but the latest of each minor version (2.1, 2.2, etc) because we need to leave around multiple minor versions for testing, we just don’t want the older patches that won’t be used.

  • Avatar
    Jason Baginski

    Here’s my machine with VS 16.4.6 and how I’m confused about the whole 3.1.10x thing and how the removal tool helps get rid of these bits. dotnet –list shows both 3.1.101 and 3.1.102 yet the uninstall tool only shows 3.1.102.

    .NET Core SDKs:
    3.1.102 x86
    3.1.102 x64 [Used by Visual Studio. Specify individually or use –force to remove]
    2.2.207 x86
    2.2.207 x64 [Used by Visual Studio 2019. Specify individually or use –force to remove]

    .NET Core Runtimes:
    3.1.2 x86
    3.1.2 x64
    2.2.8 x86
    2.2.8 x64

    dotnet –list-sdks
    2.2.207 [C:\Program Files\dotnet\sdk]
    3.1.101 [C:\Program Files\dotnet\sdk]
    3.1.102 [C:\Program Files\dotnet\sdk]

    dotnet –list-runtimes
    Microsoft.AspNetCore.All 2.2.8 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
    Microsoft.AspNetCore.App 2.2.8 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
    Microsoft.AspNetCore.App 3.1.1 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
    Microsoft.AspNetCore.App 3.1.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
    Microsoft.NETCore.App 2.2.8 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
    Microsoft.NETCore.App 3.1.1 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
    Microsoft.NETCore.App 3.1.2 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
    Microsoft.WindowsDesktop.App 3.1.1 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
    Microsoft.WindowsDesktop.App 3.1.2 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

    • Sarah Oslund
      Sarah OslundMicrosoft logo

      This tool can only be used to uninstall versions of the SDK that were installed via standalone installers or Visual Studio versions prior to 16.3. If you installed 3.1.102 manually or it was installed by a recent version of Visual Studio, then this tool cannot be used to uninstall it. For more information, the first section of our docs discuss the limitations of the tool: https://docs.microsoft.com/en-us/dotnet/core/additional-tools/uninstall-tool

        • Sarah Oslund
          Sarah OslundMicrosoft logo

          The updated behavior is that Visual Studio versions 16.3 and later manage the versions it installs on its own. As such, this tool does not uninstall versions that Visual Studio manages. In this case, it looks like 3.1.101 is managed by a Visual Studio version that manages its own installs, so we do not display it in the uninstall tool. One way to check if a version is managed by Visual Studio is to view it in Add or Remove Programs. Visual Studio managed versions are marked as such in their display names from that client.

  • Avatar
    Will Woo

    More time wasted using this article:

    Visual Studio Enterprise 16.4.6 in Win 10/64

    once again MS decides my password is not correct: reset password via e-mail code required
    there appears to be no way to get a terminal window in VStudio to enter the commands shown in this article’s screen shot.s

    a. see https://stackoverflow.com/q/58346980 for details

    b. old shortcut using command-backtick … not working.

    Whether various 3rd. party tools can enable a terminal window in VStudio, as described in other sources … for older versions ? … unknown. I’m sure not going to waste more time trying them.

    So, how about some due diligence on your part, and either a work-around, or a warning ?

    Bill Woodruff

    CodeProject Mentor
    CodeProject MVP 2015, 2017, 2019, 2020

  • Avatar
    Jon Miller

    I went through and deleted all the superfluous SDKs, but, then, I realized that the runtimes were left behind. How do a remove the runtimes? Maybe I can’t since I previously used the –sdk option when removing the SDKs?

    PS C:\Windows\System32> dotnet –info
    .NET Core SDK (reflecting any global.json):
    Version: 3.1.101
    Commit: b377529961

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

    Host (useful for support):
    Version: 3.1.1
    Commit: a1388f194c

    .NET Core SDKs installed:
    2.1.202 [C:\Program Files\dotnet\sdk]
    2.1.511 [C:\Program Files\dotnet\sdk]
    2.1.802 [C:\Program Files\dotnet\sdk]
    2.2.402 [C:\Program Files\dotnet\sdk]
    3.1.101 [C:\Program Files\dotnet\sdk]

    .NET Core runtimes installed:
    Microsoft.AspNetCore.All 2.1.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
    Microsoft.AspNetCore.All 2.1.4 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
    Microsoft.AspNetCore.All 2.1.13 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
    Microsoft.AspNetCore.All 2.1.15 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
    Microsoft.AspNetCore.All 2.2.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
    Microsoft.AspNetCore.All 2.2.8 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
    Microsoft.AspNetCore.App 2.1.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
    Microsoft.AspNetCore.App 2.1.4 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
    Microsoft.AspNetCore.App 2.1.13 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
    Microsoft.AspNetCore.App 2.1.15 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
    Microsoft.AspNetCore.App 2.2.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
    Microsoft.AspNetCore.App 2.2.8 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
    Microsoft.AspNetCore.App 3.1.1 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
    Microsoft.NETCore.App 2.0.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
    Microsoft.NETCore.App 2.1.13 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
    Microsoft.NETCore.App 2.1.15 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
    Microsoft.NETCore.App 2.2.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
    Microsoft.NETCore.App 2.2.8 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
    Microsoft.NETCore.App 3.1.1 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
    Microsoft.WindowsDesktop.App 3.1.1 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

    To install additional .NET Core runtimes or SDKs:
    https://aka.ms/dotnet-download
    PS C:\Windows\System32> dotnet-core-uninstall.exe remove 2.1.2 –runtime
    The specified version is not found: “2.1.2”.