Over time, your development machine and servers can accumulate multiple versions of .NET Core runtime and SDK installations. While having multiple versions is often necessary for compatibility, old versions you no longer need can consume valuable disk space and clutter your system. In this post, we'll walk through the process of safely identifying and uninstalling older .NET Core versions.
Why uninstall old .NET Core versions?
Before we dive into the how, let's understand why you might want to clean up old .NET installations:
- Disk Space: Each SDK version takes up several hundred megabytes
- Clarity: Fewer versions make it easier to manage your development environment
- Security: Older versions may have known vulnerabilities
- Maintenance: Keeping only what you need simplifies updates and troubleshooting
Checking installed versions
Before uninstalling anything, you need to know what's currently installed on your system.
Open your terminal or command prompt and run:
dotnet --list-sdks
This shows all installed SDK versions. You'll see output like:
3.1.426 [C:\Program Files\dotnet\sdk]
5.0.408 [C:\Program Files\dotnet\sdk]
6.0.425 [C:\Program Files\dotnet\sdk]
7.0.410 [C:\Program Files\dotnet\sdk]
8.0.404 [C:\Program Files\dotnet\sdk]
To check runtime versions:
dotnet --list-runtimes
Important considerations before uninstalling
Don't uninstall everything! Before removing versions, consider:
- Active Projects: Check which SDK versions your current projects target
- Team Requirements: Ensure you're not removing versions needed by team projects
- CI/CD Pipelines: Verify your build pipelines don't depend on specific versions
- Support Status: Keep at least one version that's currently in support
You can check .NET support lifecycle at Microsoft's official page.
Using the .NET Uninstall Tool
Microsoft provides an official uninstall tool that makes the process safe and straightforward.
- Download the msi from the official GitHub releases page
- Execute the msi to start the installation process
After the installation has completed, the dotnet-core-uninstall tool is available in the command line.
Let’s first try the list command to see the versions it can find and delete:
dotnet-core-uninstall list

Now we use the dry-run command together with a filter to see what would be impacted when executing the delete:
dotnet-core-uninstall dry-run --all-below 8.0.0 --hosting-bundle
If you're satisfied with the preview, remove the versions:
dotnet-core-uninstall remove --all-below 8.0.0 --hosting-bundle
Next to cleaning up the hosting bundles, we can do the same thing for runtimes and SDKs:
dotnet-core-uninstall remove --all-below 8.0.0 --aspnet-runtime
dotnet-core-uninstall remove --all-below 8.0.0 --runtime
dotnet-core-uninstall remove --all-below 8.0.0 --sdk
Useful options
--all-below <version>: Remove all versions below the specified version--all-but-latest: Keep only the latest version--all-previews: Remove all preview versions--sdk: Target SDK versions--runtime: Target runtime versions--force: Skip dependency checks (use carefully!)
Best practices for managing .NET Core versions
Some extra tips for managing your .NET Core versions:
- Use global.json: Pin specific projects to specific SDK versions
- Regular Cleanup: Schedule quarterly reviews of installed versions
- Keep One LTS Version: Always maintain at least one Long-Term Support version
- Document Dependencies: Keep track of which projects need which versions
- Use Docker: For older projects, consider using Docker containers instead of installing old SDKs locally
Conclusion
Cleaning up old .NET Core versions is a straightforward process that can free up significant disk space and simplify your development environment. The official .NET Uninstall Tool provides the safest method, with preview options that let you see exactly what will be removed before committing to changes.




