-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Description
Summary
dotnet workload clean --all should be enhanced to remove all workload-related artifacts on disk, including workload sets json files and manifests, to help users fully recover from corrupted or bad workload states.
Background
While working on #52434 (fixing workload repair to handle missing manifests), I observed that it's very difficult for users to recover from certain bad workload states.
For example, say a package manager deletes a manfiest file. Then, if a user deletes the sdk-manifests folder manually to try to fix this, this isn't sufficient to reset workloads to a clean state—somewhere on disk, the SDK still thinks workloads are installed. Users currently have no reliable way to get back to a "blank slate" for workloads.
Problem
dotnet workload clean --all does not remove all workload-related components:
- Workload sets may remain on disk
- Other artifacts that track installed workload state persist
- Users can get stuck in states where workloads appear installed but are broken
Proposed Solution
Enhance dotnet workload clean --all to:
- Remove workload sets
- Remove all manifest-related files
- Clear any other persisted state that tracks installed workloads
- Effectively restore the SDK to a state as if no workloads were ever installed
This would give users a reliable escape hatch when workloads get into a bad state, rather than requiring manual hunting for files across the disk.
Additional Context
- Related PR:
workload repaircan recover from corrupt workload sets #52434 (workload repair for missing manifests) - The
--allflag already implies a more aggressive cleanup, so this enhancement aligns with user expectations