DEV Community

John Smith
John Smith

Posted on • Originally published at on

How to remove the .NET Core Runtime and SDK

Today I noticed a windows machine I look after had absolutely loads of version of the dotnetcore framework installed on it.

As in every major and minor version from 1.0 to the latest 3.1 and many previews in-between.

To see if your machine has the same try this command in your terminal:

dotnet --list-sdks

Microsoft has a page titled How to remove the .NET Core Runtime and SDK which explains how to remove older versions.

There is also a tool to help uninstall these for you.

So I downloaded and installed the tool and ran the command to see list what could be uninstalled for me.

dotnet-core-uninstall list


The tool is smart in that it knows which versions are required by Visual Studio.

So I began to uninstall the undeeded dotnetcore SDK’s on the system, I started by removing all preview versions of the dotnetcore sdk.

dotnet-core-uninstall remove --sdk --all-previews


I then re-ran the tool to check these were uninstalled and to see what was left

dotnet-core-uninstall list

Then I built my final command to remove the older versions that were not needed by Visual Studio.

dotnet-core-uninstall remove --sdk 2.2.300 2.2.102 2.2.100 2.1.801 2.1.701 2.1.700 2.1.604 2.1.602 2.1.601 2.1.600 2.1.511 2.1.509 2.1.508 2.1.507 2.1.505 2.1.504 2.1.503 2.1.502 2.1.500 2.1.403 2.1.402 2.1.401 2.1.400 2.1.302 2.1.301 2.1.300 2.1.201 2.1.200 2.1.104 2.1.103 2.1.102 2.1.101 2.1.100 2.1.4 2.1.3 2.1.2 1.1.7


One final check…

dotnet-core-uninstall list


Success 🎉

Top comments (0)