Repository navigation
Description
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
- Download and install the tool.
- Display installed .NET Core SDKs and Runtimes that can be removed by this tool.
- Make sure that the tool gets elevated and uninstall .NET Core SDKs and Runtimes.
- 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-runtimeList ASP.NET Core Runtimes.
-
--hosting-bundleList .NET Core Runtime & Hosting Bundles.
-
--runtimeList .NET Core Runtimes.
-
--sdkList .NET Core SDKs.
-
-v, --verbosity <LEVEL>Set the verbosity level. Allowed values are
q[uiet],m[inimal],n[ormal],d[etailed], anddiag[nostic]. -
--x64List x64 .NET Core SDKs or Runtimes.
-
--x86List x86 .NET Core SDKs or Runtimes.
macOS
-
--runtimeList .NET Core Runtimes.
-
--sdkList .NET Core SDKs.
-
-v, --verbosity <LEVEL>Set the verbosity level. Allowed values are
q[uiet],m[inimal],n[ormal],d[etailed], anddiag[nostic]. -
--x64List x64 .NET Core SDKs or Runtimes.
-
--x86List 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
-
--allRemove 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-latestRemove .NET Core SDKs or Runtimes, except the one highest version.
-
--all-lower-patchesRemove .NET Core SDKs or Runtimes that have been superceded by higher patches.
-
--all-previewsRemove .NET Core SDKs or Runtimes that are marked as previews.
-
--all-previews-but-latestRemove .NET Core SDKs or Runtimes that are marked as previews except the one highest preview.
-
--aspnet-runtimeRemove ASP.NET Core Runtimes only.
-
--do-itActually uninstall specified .NET Core SDKs or Runtimes.
-
--hosting-bundleRemove .NET Core Runtime & Hosting Bundles only.
-
--major-minor <MAJOR_MINOR>Remove .NET Core SDKs or Runtimes that match the specified
major.minorversion. -
--runtimeRemove .NET Core Runtimes only.
-
--sdkRemove .NET Core SDKs only.
-
-v, --verbosity <LEVEL>Set the verbosity level. Allowed values are
q[uiet],m[inimal],n[ormal],d[etailed], anddiag[nostic]. -
--x64Can be used with
--sdk,--runtimeand--aspnet-runtimeto remove x64. -
--x86Can be used with
--sdk,--runtimeand--aspnet-runtimeto remove x86.
Note:
- Exactly one of
--sdkand--runtimeis required. --all,--all-below,--all-but,--all-but-latest,--all-lower-patches,--all-previews,--all-previews-but-latest,--major-minorand[<VERSION>...]are exclusive.- If neither of
--x64or--x86is specified, then both x64 and x86 will be removed.
macOS
-
--allRemove 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-latestRemove .NET Core SDKs or Runtimes, except the one highest version.
-
--all-lower-patchesRemove .NET Core SDKs or Runtimes that have been superceded by higher patches.
-
--all-previewsRemove .NET Core SDKs or Runtimes that are marked as previews.
-
--all-previews-but-latestRemove .NET Core SDKs or Runtimes that are marked as previews except the one highest preview.
-
--aspnet-runtimeRemove ASP.NET Core Runtimes only.
-
--do-itActually uninstall specified .NET Core SDKs or Runtimes.
-
--hosting-bundleRemove .NET Core Runtime & Hosting Bundles only.
-
--major-minor <MAJOR_MINOR>Remove .NET Core SDKs or Runtimes that match the specified
major.minorversion. -
--runtimeRemove .NET Core Runtimes only.
-
--sdkRemove .NET Core SDKs only.
-
-v, --verbosity <LEVEL>Set the verbosity level. Allowed values are
q[uiet],m[inimal],n[ormal],d[etailed], anddiag[nostic]. -
--x64Can be used with
--sdk,--runtimeand--aspnet-runtimeto remove x64. -
--x86Can be used with
--sdk,--runtimeand--aspnet-runtimeto remove x86.
Note:
- Exactly one of
--sdkand--runtimeis required. --all,--all-below,--all-but,--all-but-latest,--all-lower-patches,--all-previews,--all-previews-but-latest,--major-minorand[<VERSION>...]are exclusive.- If neither of
--x64or--x86is 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
KathleenDollard commentedon Jul 17, 2019
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 listlists installed .NET Core SDKs and Runtimes that can be removed with this tool."KathleenDollard commentedon Jul 17, 2019
Under Windows: typo "xactly" (E missing)
KathleenDollard commentedon Jul 17, 2019
I found this to need a lot of scrolling. Can you try the switches as a table? Something like:
--all--all-below <VERSION>yuchong-pan commentedon Jul 17, 2019
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
--sdkfor thelistcommand be "List .NET Core SDKs" or "Remove .NET Core SDKs only"?yuchong-pan commentedon Jul 18, 2019
Added installation instructions.
@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?
leecow commentedon Jul 19, 2019
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).
yuchong-pan commentedon Jul 19, 2019
@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?
yuchong-pan commentedon Jul 19, 2019
Added explanations for elevated access:
Could you take a quick look again @leecow? Thanks very much!
[-].NET Core Installation Cleanup Tool Docs[/-][+].NET Core Uninstall Tool Docs[/+]yuchong-pan commentedon Jul 29, 2019
Revised the documentation based on @KathleenDollard's and @richlander's suggestions.
yuchong-pan commentedon Aug 6, 2019
Closing as dotnet/docs#13562 is a duplicate.