DEV Community

John Smith
John Smith

Posted on • Originally published at solrevdev.com 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


Enter fullscreen mode Exit fullscreen mode

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


Enter fullscreen mode Exit fullscreen mode

2020-01-15_12_27_19.png

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


Enter fullscreen mode Exit fullscreen mode

2020-01-15_12_27_48.png

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



dotnet-core-uninstall list


Enter fullscreen mode Exit fullscreen mode

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


Enter fullscreen mode Exit fullscreen mode

2020-01-15_12_42_37.png

One final check…



dotnet-core-uninstall list


Enter fullscreen mode Exit fullscreen mode

2020-01-15_13_17_44.png

Success 🎉

Top comments (0)