Removing Old Version Of .NET - DEV Community

.NET Runtime updates are compatible with the latest major version of the .NET SDKs. This means that you can remove safely the older versions.

You can see the current SDKs and runtimes are installed on you machine with the following commands:

dotnet --list-sdks dotnet --list-runtimes Enter fullscreen mode Exit fullscreen mode

Image description

Image description

To remove the unuseful version of the SDKs and runtimes, you can use the dotnet-core-uninstall tool. It's not installed by default but you can download the installer from this link: https://github.com/dotnet/cli-lab/releases

Once you've installed it, you can use the following command to see the list with the .NET SDKs and runtimes that can be removed.

dotnet-core-uninstall list Enter fullscreen mode Exit fullscreen mode

Image description

You can also perform a what-if analysis of an uninstall. This command displays the output of an uninstall task, without performing that.

dotnet-core-uninstall whatif --all

Image description

At the end, if you are convinced of the result, you can perform the real uninstall command:

dotnet-core-uninstall remove --all-previews-but-latest Enter fullscreen mode Exit fullscreen mode

For instance, this command removes .NET SDKs and runtimes marked as previews except the one highest preview.

I use this command every month. I have a task on my calendar to remind me this important task. A clean machine is a quick machine.

You can find all the commands and all the options in the official documentation at this link: https://docs.microsoft.com/en-us/dotnet/core/additional-tools/uninstall-tool?tabs=windows

Happy cleaning!

Từ khóa » Gỡ Bỏ Sdk