Skip to content

.NET Core Uninstall Tool Docs #54

Closed

Description

@yuchong-pan

title: .NET Core Uninstall Tool
description: An overview of the .NET Core Uninstall Tool, a guided tool that enables the controlled clean-up of .NET Core SDKs and Runtimes.
author: yuchong-pan
ms.date: 07/25/2019

.NET Core Uninstall Tool

The .NET Core Uninstall Tool (dotnet-core-uninstall) is a guided tool provided to enable the controlled clean-up of a system such that only the desired versions of .NET Core SDKs and Runtimes remain. A collection of options is available to facilitate the aggregation of uninstallations.

The tool supports Windows and macOS. Linux is currently not supported.

Note that the Windows version of this tool can only uninstall .NET Core SDKs and Runtimes that were installed using .NET Core SDK or Runtime installers.

How to use the tool

  1. Download and install the tool.
  2. Display installed .NET Core SDKs and Runtimes that can be removed by this tool.
  3. Make sure that the tool gets elevated and uninstall .NET Core SDKs and Runtimes.
  4. Uninstall the tool.

Read the following sections for details.

Installing

You can download the .NET Core Uninstall Tool from https://dotnet.microsoft.com/download/dotnet-core/uninstall-tool and put the single executable (dotnet-core-uninstall.exe) in a directory.

Note: The tool requires elevation to uninstall .NET Core SDKs and Runtimes. Therefore, it should be installed in a write-protected directory such as C:\Program Files on Windows and /usr/local/bin on macOS. See also Elevated access for dotnet commands.

Displaying installed .NET Core SDKs and Runtimes

dotnet-core-uninstall list lists installed .NET Core SDKs and Runtimes that can be removed with this tool.

Synopsis

dotnet-core-uninstall list [options]

Options

Windows

  • --aspnet-runtime

    List ASP.NET Core Runtimes.

  • --hosting-bundle

    List .NET Core Runtime & Hosting Bundles.

  • --runtime

    List .NET Core Runtimes.

  • --sdk

    List .NET Core SDKs.

  • -v, --verbosity <LEVEL>

    Set the verbosity level. Allowed values are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic].

  • --x64

    List x64 .NET Core SDKs or Runtimes.

  • --x86

    List x86 .NET Core SDKs or Runtimes.

macOS

  • --runtime

    List .NET Core Runtimes.

  • --sdk

    List .NET Core SDKs.

  • -v, --verbosity <LEVEL>

    Set the verbosity level. Allowed values are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic].

  • --x64

    List x64 .NET Core SDKs or Runtimes.

  • --x86

    List x86 .NET Core SDKs or Runtimes.


Examples

  • List all .NET Core SDKs and Runtimes that can be removed with this tool:

    dotnet-core-uninstall list
    
  • List all x64 .NET Core SDKs and Runtimes:

    dotnet-core-uninstall list --x64
    
  • List all x86 .NET Core SDKs:

    dotnet-core-uninstall list --sdk --x86
    

Uninstalling .NET Core SDKs and Runtimes

dotnet-core-uninstall uses a collection of options to aggregate uninstallations, as shown below.

Since this is a destructive tool, the default behavior of a command execution is a dry run; the tool displays the .NET Core SDKs and Runtimes to be uninstalled. To actually uninstall the items, re-run the command with the --do-it option.

The tool requires elevation to uninstall .NET Core SDKs and Runtimes. Run the tool in an Administrator command prompt on Windows and with sudo on macOS.

Synopsis

dotnet-core-uninstall [options] [<VERSION>...]

Arguments

VERSION

The specified version to uninstall.

Options

Windows

  • --all

    Remove all .NET Core SDKs or Runtimes.

  • --all-below <VERSION>

    Remove .NET Core SDKs or Runtimes below the specified version. The specified version will remain.

  • --all-but <VERSIONS>

    Remove .NET Core SDKs or Runtimes, except those specified.

  • --all-but-latest

    Remove .NET Core SDKs or Runtimes, except the one highest version.

  • --all-lower-patches

    Remove .NET Core SDKs or Runtimes that have been superceded by higher patches.

  • --all-previews

    Remove .NET Core SDKs or Runtimes that are marked as previews.

  • --all-previews-but-latest

    Remove .NET Core SDKs or Runtimes that are marked as previews except the one highest preview.

  • --aspnet-runtime

    Remove ASP.NET Core Runtimes only.

  • --do-it

    Actually uninstall specified .NET Core SDKs or Runtimes.

  • --hosting-bundle

    Remove .NET Core Runtime & Hosting Bundles only.

  • --major-minor <MAJOR_MINOR>

    Remove .NET Core SDKs or Runtimes that match the specified major.minor version.

  • --runtime

    Remove .NET Core Runtimes only.

  • --sdk

    Remove .NET Core SDKs only.

  • -v, --verbosity <LEVEL>

    Set the verbosity level. Allowed values are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic].

  • --x64

    Can be used with --sdk, --runtime and --aspnet-runtime to remove x64.

  • --x86

    Can be used with --sdk, --runtime and --aspnet-runtime to remove x86.

Note:

  1. Exactly one of --sdk and --runtime is required.
  2. --all, --all-below, --all-but, --all-but-latest, --all-lower-patches, --all-previews, --all-previews-but-latest, --major-minor and [<VERSION>...] are exclusive.
  3. If neither of --x64 or --x86 is specified, then both x64 and x86 will be removed.

macOS

  • --all

    Remove all .NET Core SDKs or Runtimes.

  • --all-below <VERSION>

    Remove .NET Core SDKs or Runtimes below the specified version. The specified version will remain.

  • --all-but <VERSIONS>

    Remove .NET Core SDKs or Runtimes, except those specified.

  • --all-but-latest

    Remove .NET Core SDKs or Runtimes, except the one highest version.

  • --all-lower-patches

    Remove .NET Core SDKs or Runtimes that have been superceded by higher patches.

  • --all-previews

    Remove .NET Core SDKs or Runtimes that are marked as previews.

  • --all-previews-but-latest

    Remove .NET Core SDKs or Runtimes that are marked as previews except the one highest preview.

  • --aspnet-runtime

    Remove ASP.NET Core Runtimes only.

  • --do-it

    Actually uninstall specified .NET Core SDKs or Runtimes.

  • --hosting-bundle

    Remove .NET Core Runtime & Hosting Bundles only.

  • --major-minor <MAJOR_MINOR>

    Remove .NET Core SDKs or Runtimes that match the specified major.minor version.

  • --runtime

    Remove .NET Core Runtimes only.

  • --sdk

    Remove .NET Core SDKs only.

  • -v, --verbosity <LEVEL>

    Set the verbosity level. Allowed values are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic].

  • --x64

    Can be used with --sdk, --runtime and --aspnet-runtime to remove x64.

  • --x86

    Can be used with --sdk, --runtime and --aspnet-runtime to remove x86.

Note:

  1. Exactly one of --sdk and --runtime is required.
  2. --all, --all-below, --all-but, --all-but-latest, --all-lower-patches, --all-previews, --all-previews-but-latest, --major-minor and [<VERSION>...] are exclusive.
  3. If neither of --x64 or --x86 is specified, then both x64 and x86 will be removed.

Examples

  • Dry run of uninstalling all .NET Core SDKs that can be removed by this tool:

    dotnet-core-uninstall --all --sdk
    
  • Uninstall all .NET Core SDKs below the version 2.2.301:

    dotnet-core-uninstall --all-below 2.2.301 --sdk --do-it
    
  • Uninstall all x86 .NET Core Runtimes except the version 3.0.0-preview6-27804-01:

    dotnet-core-uninstall --all-but 3.0.0-preview6-27804-01 --runtime --do-it
    
  • Uninstall all .NET Core 1.1 SDKs:

    dotnet-core-uninstall --major-minor 1.1 --do-it
    

Uninstalling the tool

Remove the downloaded single executable dotnet-core-uninstall.exe from the directory where it was installed.

Activity

  1. KathleenDollard commented on Jul 17, 2019

    @KathleenDollard

    Looks good.

    "dotnet-core-uninstall list is a command that lists installed .NET Core SDKs and Runtimes that can be removed with this tool."

    "dotnet-core-uninstall list lists installed .NET Core SDKs and Runtimes that can be removed with this tool."

  2. KathleenDollard commented on Jul 17, 2019

    @KathleenDollard

    Under Windows: typo "xactly" (E missing)

  3. KathleenDollard commented on Jul 17, 2019

    @KathleenDollard

    I found this to need a lot of scrolling. Can you try the switches as a table? Something like:

    Switch Action Windows Mac
    --all Remove all .NET Core SDKs or Runtimes. yes yes
    --all-below <VERSION> Remove .NET Core SDKs or Runtimes below the specified version. The specified version will remain. yes yes
  4. yuchong-pan commented on Jul 17, 2019

    @yuchong-pan
    ContributorAuthor

    Thanks @KathleenDollard! I'll make the options a table. However, on the docs I believe that it will display as tabs, something like https://docs.microsoft.com/en-us/dotnet/core/versions/remove-runtime-sdk-versions?tabs=windows. Additionally docs for other commands use lists for options, e.g. https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-build.

    A related question: For the tool's help page, should the description of --sdk for the list command be "List .NET Core SDKs" or "Remove .NET Core SDKs only"?

  5. yuchong-pan commented on Jul 18, 2019

    @yuchong-pan
    ContributorAuthor

    Added installation instructions.

    Installing

    You can download the .NET Core Installation Cleanup Tool from https://dotnet.microsoft.com/download/dotnet-core/uninstall-tool and put the single executable (dotnet-core-uninstall.exe) in a directory.

    Note: Be aware that, since the tool requires elevation, it should be installed in a write-protected directory (e.g., C:\Program Files on Windows).

    @KathleenDollard Could you also take a quick look on it? Thanks!

    @wli3 Are there write-protected locations on macOS that we should be aware of?

  6. leecow commented on Jul 19, 2019

    @leecow
    Member

    Looks good and I'm fine with either tables or tabs. If the docs will live on docs.microsoft.com then tabs make sense for formatting consistency. On GitHub, I don't think tabs are an option.

    The only addition might be a note on why Linux is not represented (not needed because package managers handle the cleanup).

  7. yuchong-pan commented on Jul 19, 2019

    @yuchong-pan
    ContributorAuthor

    @leecow Thanks for your review! Since the docs will be on docs.microsoft.com, I switched the "Options" section to tabs. I also added a paragraph explaining why Linux is not supported. Could you take a quick look again?

    The tool currently supports Windows and macOS. The Linux operating systems are not supported because .NET Core installations and clean-ups are well managed by package managers.

  8. yuchong-pan commented on Jul 19, 2019

    @yuchong-pan
    ContributorAuthor

    Added explanations for elevated access:

    Since the tool requires elevation to uninstall .NET Core SDKs and Runtimes, it should be run with elevated access. On Windows, run the tool in a command prompt with administrator privileges. On macOS, add sudo before the command.

    Could you take a quick look again @leecow? Thanks very much!

  9. changed the title [-].NET Core Installation Cleanup Tool Docs[/-] [+].NET Core Uninstall Tool Docs[/+] on Jul 23, 2019
  10. yuchong-pan commented on Jul 29, 2019

    @yuchong-pan
    ContributorAuthor

    Revised the documentation based on @KathleenDollard's and @richlander's suggestions.

  11. yuchong-pan commented on Aug 6, 2019

    @yuchong-pan
    ContributorAuthor

    Closing as dotnet/docs#13562 is a duplicate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions