Skip to content

Proposal: Unified Cross-Platform .NET SDK Cleanup & Version Management Tooling #10164

@dgnoztrk

Description

@dgnoztrk

URL(s)

N/A – This request is not related to any existing release notes.
It is a standalone feature proposal for .NET SDK cleanup and version management.

Description

Summary

Managing multiple .NET SDK and Runtime versions across Windows, Linux, and macOS has become increasingly challenging—especially in environments using .NET 7/8/9, multi-architecture setups (x64 + arm64), CI/CD pipelines, and long-lived developer machines.

Today, .NET provides:

dotnet --list-sdks → lists versions only

OS-specific uninstall instructions → inconsistent and often incomplete

No official cross-platform cleanup/maintenance tool

No way to safely identify unused SDKs

No "dry-run" or automated removal process

As a result, SDK folders accumulate over time, causing path conflicts, global.json mismatches, container bloat, and broken build pipelines—especially in shared build servers and multi-repo organizations.

This proposal aims to introduce an official, consistent, cross-platform solution for cleaning, auditing, and managing installed .NET SDK versions.

Proposed Feature

Introduce a new cross-platform command:
dotnet sdk cleanup

Dry-run mode:
dotnet sdk cleanup --dry-run

Automated cleanup:
dotnet sdk cleanup --all-unused

Machine-readable output:
dotnet sdk cleanup --json

Auditing capability:
dotnet sdk audit
-Lists installed versions, global.json mappings, usage history, and age of SDKs.

Problem Statement

Developers frequently struggle with:

  1. Inconsistent removal procedures

Each OS requires different techniques to uninstall SDKs, which is error-prone and poorly documented.

  1. Accumulation of unused SDKs

Installed SDK versions often remain indefinitely, leading to multi-GB clutter and degraded performance in CI runners.

  1. global.json conflicts

Projects referencing older SDK versions can unexpectedly break when outdated SDK folders are manually removed or overwritten.

  1. Multi-architecture issues

macOS and Linux often contain both arm64 and x64 SDK installations; safely removing one is difficult.

  1. Docker/CI environments

In containers, every MB matters—yet SDKs accumulate unless manually pruned.

  1. No programmatic cleanup methods

Automation scripts must manually inspect directory structures instead of using an official API or CLI mechanism.

In short:
We have a great way to install SDKs, but no official way to manage or clean them.

🏷️ Suggested Labels

  • area-SDK
    Indicates that this proposal relates directly to .NET SDK behavior, version management, and CLI enhancements.

  • enhancement
    Marks this as a feature request rather than a bug report.

  • area-UX
    Highlights that the proposal improves developer experience across platforms.

  • doc (optional)
    Suggests adding or updating official documentation to support cross-platform SDK cleanup workflows.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions