- Article
- 11 minutes to read
The .NET uninstall tool (dotnet-core-uninstall
) lets you remove .NET SDKs and runtimes from a system. A collection of options is available to specify which versions you want to uninstall.
The tool supports Windows and macOS. Linux is currently not supported.
On Windows, the tool can only uninstall SDKs and runtimes that were installed using one of the following installers:
- The .NET SDK and runtime installer.
- The Visual Studio installer in versions earlier than Visual Studio 2019 version 16.3.
On macOS, the tool can only uninstall SDKs and runtimes located in the /usr/local/share/dotnet folder.
Because of these limitations, the tool might not be able to uninstall all of the .NET SDKs and runtimes on your machine. You can use the dotnet --info
command to find all of the .NET SDKs and runtimes installed, including those SDKs and runtimes that the tool can't remove. The dotnet-core-uninstall list
command displays which SDKs can be uninstalled with the tool. Versions 1.2 and later can uninstall SDKs and runtimes with version 5.0 or earlier, and previous versions of the tool can uninstall 3.1 and earlier.
You can download .NET uninstall tool from the tool's releases page and find the source code at the dotnet/cli-lab GitHub repository.
Note
The tool requires elevation to uninstall .NET SDKs and runtimes. Therefore, it should be installed in a write-protected directory such as C:\Program Files on Windows or /usr/local/bin on macOS. For more information, see the Elevated access for dotnet commands and the detailed installation instructions.
Run the tool
The following steps show the recommended approach for running the uninstall tool:
- Step 1 - Display installed .NET SDKs and runtimes
- Step 2 - Do a dry run
- Step 3 - Uninstall .NET SDKs and runtimes
- Step 4 - Delete the NuGet fallback folder (optional)
Step 1 - Display installed .NET SDKs and runtimes
The dotnet-core-uninstall list
command lists the installed .NET SDKs and runtimes that can be removed with this tool. Some SDKs and runtimes might be required by Visual Studio and they're displayed with a note of why it isn't recommended to uninstall them.
Note
The output of the dotnet-core-uninstall list
command won't match the list of installed versions in the output of dotnet --info
in most cases. Specifically, this tool won't display versions installed by zip files or managed by Visual Studio (any version installed with Visual Studio 2019 version 16.3 or later). One way to check if a version is managed by Visual Studio is to view it in Add or Remove Programs
, where Visual Studio managed versions are marked as such in their display names.
For more information, see list command later in this article.
Step 2 - Do a dry run
The dotnet-core-uninstall dry-run
and dotnet-core-uninstall whatif
commands display the .NET SDKs and runtimes that will be removed based on the options provided without performing the uninstall. These commands are synonyms.
For more information, see dry-run and whatif commands later in this article.
Step 3 - Uninstall .NET SDKs and Runtimes
dotnet-core-uninstall remove
uninstalls .NET SDKs and Runtimes that are specified by a collection of options. Versions 1.2 and later can uninstall SDKs and runtimes with version 5.0 or earlier, and previous versions of the tool can uninstall 3.1 and earlier.
Since this tool has a destructive behavior, it's highly recommended that you do a dry run before running the remove command. The dry run will show you what .NET SDKs and runtimes will be removed when you use the remove
command. Refer to Should I remove a version? to learn which SDKs and runtimes are safe to remove.
Caution
Keep in mind the following caveats:
- This tool can uninstall versions of the .NET SDK that are required by
global.json
files on your machine. You can reinstall .NET SDKs from the Download .NET page. - This tool can uninstall versions of the .NET Runtime that are required by framework dependent applications on your machine. You can reinstall .NET Runtimes from the Download .NET page.
- This tool can uninstall versions of the .NET SDK and runtime that Visual Studio relies on. If you break your Visual Studio installation, run "Repair" in the Visual Studio installer to get back to a working state.
By default, all commands keep the .NET SDKs and runtimes that may be required by Visual Studio or other SDKs. These SDKs and runtimes can be uninstalled by listing them explicitly as arguments or by using the --force
option.
The tool requires elevation to uninstall .NET SDKs and runtimes. Run the tool in an Administrator command prompt on Windows and with sudo
on macOS. The dry-run
and whatif
commands don't require elevation.
For more information, see remove command later in this article.
Step 4 - Delete the NuGet fallback folder (optional)
In some cases, you no longer need the NuGetFallbackFolder
and may wish to delete it. For more information, see Remove the NuGetFallbackFolder.
- Windows
- macOS
- Open Add or Remove Programs.
- Search for
Microsoft .NET SDK Uninstall Tool
. - Select Uninstall.
list
command
Synopsis
dotnet-core-uninstall list [options]
Options
- Windows
- macOS
--aspnet-runtime
Lists all the ASP.NET runtimes that can be uninstalled with this tool.
--hosting-bundle
Lists all the .NET hosting bundles that can be uninstalled with this tool.
--runtime
Lists all the .NET runtimes that can be uninstalled with this tool.
--sdk
Lists all the .NET SDKs that can be uninstalled with this tool.
-v, --verbosity <LEVEL>
Sets the verbosity level. Allowed values are
q[uiet]
,m[inimal]
,n[ormal]
,d[etailed]
, anddiag[nostic]
. The default value isnormal
.--x64
Lists all the x64 .NET SDKs and runtimes that can be uninstalled with this tool.
--x86
Lists all the x86 .NET SDKs and runtimes that can be uninstalled with this tool.
Examples
List all the .NET SDKs and runtimes that can be removed with this tool:
dotnet-core-uninstall list
List all the x64 .NET SDKs and runtimes:
dotnet-core-uninstall list --x64
List all the x86 .NET SDKs:
dotnet-core-uninstall list --sdk --x86
dry-run
and whatif
commands
Synopsis
dotnet-core-uninstall dry-run [options] [<VERSION>...]dotnet-core-uninstall whatif [options] [<VERSION>...]
Arguments
VERSION
The specified version to uninstall. You can list several versions one after the other, separated by spaces. Response files are also supported.
Tip
Response files are an alternative to placing all the versions on the command line. They're text files, typically with a *.rsp extension, and each version is listed on a separate line. To specify a response file for the VERSION
argument, use the @ character immediately followed by the response file name.
Options
- Windows
- macOS
--all
Removes all the .NET SDKs and runtimes.
--all-below <VERSION>[ <VERSION>...]
Removes only the .NET SDKs and runtimes with a version smaller than the specified version. The specified version remains installed.
--all-but <VERSIONS>[ <VERSION>...]
(Video) How to Install or Uninstall Microsoft .Net Framework 2 0 and 3 0 in Windows 10 & 11Removes all the .NET SDKs and runtimes, except those versions specified.
--all-but-latest
Removes the .NET SDKs and runtimes, except the highest version.
--all-lower-patches
Removes the .NET SDKs and runtimes superseded by higher patches. This option protects global.json file.
--all-previews
Removes the .NET SDKs and runtimes marked as previews.
--all-previews-but-latest
Removes the .NET SDKs and runtimes marked as previews except the highest preview.
--aspnet-runtime
Removes the ASP.NET runtimes only.
--hosting-bundle
Removes the .NET runtime and hosting bundles only.
--major-minor <MAJOR_MINOR>
See AlsoRemove existing MSI versions of Office when upgrading to Microsoft 365 Apps - Deploy OfficeDelete or restore user mailboxes in Exchange OnlineList.Remove(T) Method (System.Collections.Generic) Removes the .NET SDKs and runtimes that match the specified
major.minor
version.--runtime
Removes the .NET runtimes only.
--sdk
Removes the .NET SDKs only.
-v, --verbosity <LEVEL>
Sets the verbosity level. Allowed values are
q[uiet]
,m[inimal]
,n[ormal]
,d[etailed]
, anddiag[nostic]
. The default value isnormal
.--x64
Must be used with
--sdk
,--runtime
, and--aspnet-runtime
to remove x64 SDKs or runtimes.--x86
Must be used with
--sdk
,--runtime
, and--aspnet-runtime
to remove x86 SDKs or runtimes.--force
Forces removal of versions that might be used by Visual Studio.
Note
- Exactly one of
--sdk
,--runtime
,--aspnet-runtime
, and--hosting-bundle
is required. --all
,--all-below
,--all-but
,--all-but-latest
,--all-lower-patches
,--all-previews
,--all-previews-but-latest
,--major-minor
, and[<VERSION>...]
are exclusive.- If
--x64
or--x86
aren't specified, then both x64 and x86 will be removed.
Examples
Note
By default, .NET SDKs and runtimes that might be required by Visual Studio or other SDKs aren't included in the dotnet-core-uninstall dry-run
output. In the following examples, depending on the state of the machine, some of the specified SDKs and runtimes might not be included in the output. To include all the SDKs and runtimes, list them explicitly as arguments or use the --force
option.
Dry run of removing all the .NET runtimes that have been superseded by higher patches:
dotnet-core-uninstall dry-run --all-lower-patches --runtime
Dry run of removing all the .NET SDKs below the version
2.2.301
:dotnet-core-uninstall whatif --all-below 2.2.301 --sdk
remove
command
Synopsis
dotnet-core-uninstall remove [options] [<VERSION>...]
Arguments
VERSION
The specified version to uninstall. You might list several versions one after the other, separated by spaces. Response files are also supported.
Tip
Response files are an alternative to placing all the versions on the command line. They're text files, typically with a *.rsp extension, and each version is listed on a separate line. To specify a response file for the VERSION
argument, use the @ character immediately followed by the response file name.
Options
- Windows
- macOS
--all
Removes all the .NET SDKs and runtimes.
--all-below <VERSION>[ <VERSION>...]
Removes only the .NET SDKs and runtimes with a version smaller than the specified version. The specified version remains installed.
--all-but <VERSIONS>[ <VERSION>...]
Removes all the .NET SDKs and runtimes, except those versions specified.
--all-but-latest
Removes the .NET SDKs and runtimes, except the highest version.
--all-lower-patches
Removes the .NET SDKs and runtimes superseded by higher patches. This option protects global.json file.
--all-previews
Removes the .NET SDKs and runtimes marked as previews.
--all-previews-but-latest
Removes the .NET SDKs and runtimes marked as previews except the highest preview.
--aspnet-runtime
Removes the ASP.NET runtimes only.
--hosting-bundle
Removes the .NET hosting bundles only.
(Video) Remove .NET SDK from macOS using dotnet-uninstall-tool--major-minor <MAJOR_MINOR>
Removes the .NET SDKs and runtimes that match the specified
major.minor
version.--runtime
Removes the .NET runtimes only.
--sdk
Removes the .NET SDKs only.
-v, --verbosity <LEVEL>
Sets the verbosity level. Allowed values are
q[uiet]
,m[inimal]
,n[ormal]
,d[etailed]
, anddiag[nostic]
. The default value isnormal
.--x64
Must be used with
--sdk
,--runtime
, and--aspnet-runtime
to remove x64 SDKs or runtimes.--x86
Must be used with
--sdk
,--runtime
, and--aspnet-runtime
to remove x86 SDKs or runtimes.-y, --yes
Executes the command without requiring a yes or no confirmation.
--force
Forces removal of versions that might be used by Visual Studio.
Note
- Exactly one of
--sdk
,--runtime
,--aspnet-runtime
, and--hosting-bundle
is required. --all
,--all-below
,--all-but
,--all-but-latest
,--all-lower-patches
,--all-previews
,--all-previews-but-latest
,--major-minor
, and[<VERSION>...]
are exclusive.- If
--x64
or--x86
aren't specified, then both x64 and x86 will be removed.
Examples
Note
By default, .NET SDKs and runtimes that might be required by Visual Studio or other SDKs are kept. In the following examples, depending on the state of the machine, some of the specified SDKs and runtimes might remain. To remove all the SDKs and runtimes, list them explicitly as arguments or use the --force
option.
Remove all the .NET runtimes except the version
3.0.0-preview6-27804-01
without requiring yes or no confirmation:dotnet-core-uninstall remove --all-but 3.0.0-preview6-27804-01 --runtime --yes
Remove all the .NET Core 1.1 SDKs without requiring yes or no confirmation:
dotnet-core-uninstall remove --sdk --major-minor 1.1 -y
Remove the .NET Core 1.1.11 SDK with no console output:
dotnet-core-uninstall remove 1.1.11 --sdk --yes --verbosity q
Remove all the .NET SDKs that can be safely removed by this tool:
dotnet-core-uninstall remove --all --sdk
Remove all the .NET SDKs that can be removed by this tool, including those SDKs that might be required by Visual Studio (not recommended):
dotnet-core-uninstall remove --all --sdk --force
Remove all the .NET SDKs that are specified in the versions.rsp response file:
dotnet-core-uninstall remove --sdk @versions.rsp
The content of the versions.rsp file is as follows:
2.2.3002.1.700
FAQs
How do I uninstall a dotnet tool? ›
...
Description
- To uninstall a global tool that was installed in the default location, use the --global option.
- To uninstall a global tool that was installed in a custom location, use the --tool-path option.
- To uninstall a local tool, omit the --global and --tool-path options.
Unless your application has specific reasons for earlier SDKs or runtimes, you may safely remove older versions.
Can .net be uninstalled? ›NET Framework cannot be uninstalled on Windows 8 and 10. Because of this the preferred method is to repair . NET Framework and to run the System File Checker.
How do I fix a corrupted .NET Framework? ›- Press Win + R to open Run.
- Type control and click OK to open Control Panel.
- Next, click on Programs and then click on Programs and Features.
- In the left pane, click on Turn Windows features On or Off.
- Here, uncheck . NET Framework 3.5 and . ...
- Click OK.
- On your keyboard, press the Windows key + R.
- Type cmd, then press Enter.
- Type one of the following commands depending on your version of ASP.NET. ...
- Press Enter.
- Type aspnet_regiis.exe –u then press Enter to start uninstalling.
- After the notification information prompt appears, close the command prompt.
- Select Start , then select Settings > Apps > Apps & features.
- Select the app you want to remove, and then select Uninstall.
Open the Windows Start menu. Type "Control Panel" into the search and open Control Panel. Go to Programs and Features. Select Uninstall a Program.
How do I uninstall and reinstall .NET Framework? ›- Click Windows® Start, select Settings, select Control Panel.
- Click Programs and Features.
- Uninstall Microsoft .NET Framework 4 Extended.
- Uninstall Microsoft .NET Framework 4 Client Profile.
- Reboot computer.
NET SDK is a set of libraries and tools that allow developers to create . NET applications and libraries. It contains the following components that are used to build and run applications: The . NET CLI.
Do I need .NET SDK? ›Only the . NET Core Runtime is required to run an application and provides information about the install. To develop, build and publish an application will require an SDK.
Do I need .NET Framework? ›
Why do I need .NET Framework? You need .NET Framework installed to run applications on Windows that were created using .NET Framework. It's already included in many versions of Windows.
How do I turn off Microsoft Net? ›- Access the Control Panel, click on Programs and then on the option Turn Windows features on or off;
- Select Microsoft .NET Framework 4.8;
- Uncheck the selected box and click OK;
- Wait while the feature is disabled;
- Click Close. Microsoft .
Open the Control Panel. Select Add/Remove Programs. Highlight Microsoft.NET Framework 2.0 and click Change/Remove. Select Repair or Uninstall.
How to repair NET Framework in Windows 10? ›- Close all running software applications.
- Go to Windows Start Menu -> Control Panel -> Add or Remove Programs or Program and Features.
- Select Microsoft . ...
- Click Change/Uninstall, Remove or Repair.
- Select the Repair option, click Next.
- The wizard will perform a repair on the . ...
- It is suggested to restart the Computer.
- DISM /online /disable-feature /FeatureName:NetFx3.
- DISM /online /enable-feature /FeatureName:NetFx3.
- "%WINDIR%\Microsoft.NET\Framework\v3.5\Microsoft .NET 3.5 SP1\setup.exe" /qb /norestart.
- /qb.
- /q.
- On the Programs and Features window, select Microsoft . NET Framework 4.5 or later, then click Uninstall/Change.
- Select Repair, then Next.
- Follow on-screen instructions to repair the application. Make sure to reboot your computer after repairing . NET framework.
This tool troubleshoots common issues with the setup of Microsoft . NET Framework or with updates to Microsoft . NET Framework setup installation. Additionally, this tool tries to resolve these issues by applying known fixes or by repairing the installed product.
How do I uninstall .NET Framework 4.7 2 on Windows 10? ›04-Aug-2020•Knowledge Article
Navigate to Control Panel | Add/Remove Programs (Programs and Features) | click the View Installed Updates link on the left. Search for the following KB numbers and uninstall them if they exist.
NET Runtime updates are compatible with the latest major version of the . NET SDKs. This means that you can remove safely the older versions. To remove the unuseful version of the SDKs and runtimes, you can use the dotnet-core-uninstall tool.
How to uninstall .NET Framework 4.6 on Windows Server 2016? ›1 by going to Control Panel > Programs > Programs and Features > View Installed Updates. Search for or scroll down the list of Microsoft Windows updates to find Update for Microsoft Windows (KB3102467) and click Uninstall. Click Yes to uninstall . NET Framework 4.6.
How do I force uninstall a program that won't uninstall? ›
Press down the CTRL + SHIFT + ESC keys together to open the Task Manager. It should already be on the processes tab. Select the Program or App that you want to uninstall from the list under processes. Now try running the uninstall on the Program/App again.
How do I uninstall something that won't uninstall? ›- Restart the Windows Installer. ...
- End the App's Process in the Task Manager. ...
- Uninstall the App in Safe Mode. ...
- Use the Program's Default Uninstaller. ...
- Remove the Program's Registry Keys.
This may take from 15 to 30 minutes depending on your computer's hardware. DO NOT CLOSE ANY WINDOWS OR USE YOUR COMPUTER WHILE THE PROGRAM IS RUNNING. The windows will close once the program is complete. Remember, your computer will restart after the program is complete and this window closes.
Does Windows 10 need NET Framework? ›NET Framework is required to run many applications on Windows. The instructions in this article should help you install the . NET Framework versions that you need.
Can you repair .NET Framework? ›You can repair your . NET Framework install using the . NET Framework Repair Tool.
How do I run .NET repair tool? ›- Select the files to download and click Next:
- Run the NetFxRepairTool.exe file. ...
- You will see changes the tool recommends making. ...
- When the changes are made, do not click Finish but click Next:
- On the final step, click Finish:
- Restart your machine.
Go to Control Panel > Programs > Turn Windows features on or off, verify if . NET Framework 3.5 checkbox is selected and then proceed with the software installation. If the error persits, we will have to force the installation with the Windows command prompt (CMD).
Is .NET same as C#? ›Microsoft's implementation of C# is also heavily integrated with the . NET framework, so it's understandable that these two concepts would be confused, but they are different things. C# is a programming language and . NET is the framework and runtime that C# programs are built with and run on.
What is .NET and why it is used? ›NET is an open-source platform for building desktop, web, and mobile applications that can run natively on any operating system. The . NET system includes tools, libraries, and languages that support modern, scalable, and high-performance software development. An active developer community maintains and supports the .
How do you check if I have .NET SDK? ›You can see both the SDK versions and runtime versions with the command dotnet --info . You'll also get other environmental related information, such as the operating system version and runtime identifier (RID).
Where does .NET SDK get installed? ›
NET 6 SDK or . NET 7 SDK, it's installed to the C:\Program Files\dotnet\x64\ folder.
Do I have .NET installed? ›The version of .NET Framework (4.5 and later) installed on a machine is listed in the registry at HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full. If the Full subkey is missing, then .NET Framework 4.5 or above isn't installed.
Does anyone still use .NET Framework? ›It has been one of the essential technologies for many years and is still very popular today. In fact, according to Stack Overflow's survey of developers' preferred programming languages, . NET is still the top choice for web development.
What happens if the .NET Framework is not installed? ›If the . NET Framework version a program needs is not installed, you'll get an error message like the one shown below. The application error message will usually detail the version that's required. The .
Is there a difference between .NET and .NET Framework? ›In simple terms, . NET Core is the latest version of Microsoft's . NET Framework( The framework is a reusable design platform for software systems, which provides support for code libraries and various scripting languages ), which is a free, open-source, general-purpose programming platform.
Can I disable .NET Framework? ›Connect:Direct Windows does not use the . NET Framework. It can be removed/deleted from Windows machine.
How do I block .NET Framework? ›...
- After you select this subkey, point to New on the Edit menu, and then click Key.
- Type WU, and then press Enter.
- Right-click WU point to New, and then click DWORD Value.
- Type BlockNetFramework48, and then press Enter.
- Right-click BlockNetFramework48, and then click Modify.
You can get rid of loading . net framework in Excel 2019 by doing File, Info, Check for Issues/Inspect Document and ticking Custom XML Data (you can tick everything else as well, but it will take a long time). It will tell you that Custom XML Data was found, so press Remove. Then close and save.
How do you fix .NET Framework 3.5 includes net 2.0 and 3.0 couldn't be installed? ›- Press the Windows key. on your keyboard, type "Windows Features", and press Enter. ...
- Select the .NET Framework 3.5 (includes .NET 2.0 and 3.0) check box, select OK, and reboot your computer if prompted.
That means the 4.8 version is not supported by your current operating windows, actually, you need to upgrade your windows. Visit https://www.microsoft.com/en-us/software-download/windows10, go to "Create Windows 10 installation media" section and download the tool. Install the tool and run it.
How to fix Microsoft .NET Framework error unhandled exception? ›
- Install the latest Windows Update.
- Try to use the Microsoft . NET Framework Repair Tool. ...
- Use System File Checker to check and fix corrupted system files which may be the cause of the issue. ...
- Enable and disable . ...
- Uninstall and reinstall the game.
- Try to perform a Repair Upgrade.
...
NET Framework 4.5 (or later) checkbox is already checked:
- Select the checkbox to turn off . ...
- Select OK to save your changes.
- Restart your computer.
To work around this issue, install the d3dcompiler update from following links before you install the . NET Framework 4.7. The update is also available on Microsoft Update Catalog and through Windows Update.
Why is NET Framework 4.7 not installing? ›Possible Causes: The machine on which you are installing the product does not meet all the . NET Framework system requirements. Microsoft Windows Hotfix KB4019990 for Windows 7 and Windows 2012 Server was not installed prior to installing the product or the hotfix did not install successfully.
How to fix the .NET Framework 4.7 2 is not supported on this operating system error in Windows 10? ›The only solution for this problem is to simply update your Windows 10. It is advised to check for Windows Updates even if you are on the latest version of Windows 10. Since the problem is caused by incompatible operating system, installing all the available Windows 10 updates will most likely resolve the issue.