Skip to content

.NET keeps 11 GB of SDKs and three separate package caches

Every SDK you installed is still there, and NuGet caches in three places. The commands that list them and the one that clears them all.

5 min read

Installing a .NET SDK never replaces the previous one, by design, so that a project pinned to an older version keeps building. After a few years that is a folder of SDKs, most of which nothing on the machine targets.

What is installed

dotnet --list-sdks
dotnet --list-runtimes

Each SDK is roughly a gigabyte and each runtime a few hundred megabytes. Compare that list against what your projects actually pin, which is written in global.json where it is pinned at all.

Removing old SDKs

There is no uninstall command in the tooling itself. Microsoft ships a separate .NET Uninstall Tool that lists what is installed and removes versions safely, and it is the supported route. The manual alternative is Settings, Apps, where each SDK and runtime appears as its own entry, which is why that list is so long on a development machine.

The three NuGet caches

dotnet nuget locals all --list
dotnet nuget locals all --clear
CacheWhereWhat it holds
global-packages%USERPROFILE%\.nuget\packagesEvery package version ever restored
http-cache%LOCALAPPDATA%\NuGet\v3-cacheResponses from the feed
temp%TEMP%\NuGetScratchScratch from interrupted restores

The global packages folder is the large one, and it is the one that grows without limit: nothing removes an old version when a project moves on. Everything in all three is redownloadable, so clearing costs a slow restore and nothing else.

Build output across projects

Get-ChildItem $env:USERPROFILE -Recurse -Directory -Include bin,obj -Force -ErrorAction SilentlyContinue |
  Measure-Object | Select-Object Count

bin and obj in every project are regenerated by the next build and are frequently larger in total than the SDKs. For a project you are not building this week they are free space.

Where this sits

On a machine that also has the IDE, Visual Studio itself is the larger number, and the general order for a full drive is in why the C drive is full.

Common questions

Where is the NuGet cache on Windows?

In three places: %USERPROFILE%\.nuget\packages for global packages, %LOCALAPPDATA%\NuGet\v3-cache for HTTP responses, and a scratch folder in %TEMP%. dotnet nuget locals all --list prints all three.

How do I clear the NuGet cache?

Run dotnet nuget locals all --clear, which empties all three. Everything in them is downloaded again on the next restore, so the cost is time rather than anything lost.

How do I remove old .NET SDKs?

Use Microsoft's .NET Uninstall Tool, which lists installed versions and removes them safely, or remove them individually from Settings, Apps where each appears as its own entry.

How much space does .NET use on Windows?

On a machine measured in September 2026, C:\Program Files\dotnet was 11.6 GB for SDKs and runtimes alone, before any restored packages or build output.

Read next