dotnet / cli-lab

A guided tool will be provided to enable the controlled clean up of a system such that only the desired versions of the Runtime and SDKs remain.
MIT License
602 stars 55 forks source link

Add support for workloads as part of the uninstall tool #303

Open marcpopMSFT opened 2 months ago

marcpopMSFT commented 2 months ago

.NET SDK workloads are optional extensions to the SDK itself. They were designed this way to allow for including pieces that are too big to be included in the default SDK (the wasm-tools workload includes packages that are many times bigger than the current SDK for example).

As you install new workloads, the garbage collector in the workloads process to trigger to clean up old workload packs no longer in use. Additionally, on windows, the admin install has a finalizer that runs on uninstall that attempts to clean up worklaods before being removed. We've found that for various reasons, this doesn't always work (if you've installed a new SDK band, you're using a file-based install, etc).

Read more here

To alleviate some of the pain of leftover workload packs we added dotnet workload clean. Read more here

The guidance for removing an SDK with workloads to get to a clean state is the following:

This issue proposes adding workloads support to the uninstall tool to help you track what you have installed across the current and other SDK bands as well as remove them.