Back to All Guides
Windows WindowsVisual StudioDeveloper

Visual Studio's Hidden Build Cache Is Bigger Than You Think

Every time you compile a .NET solution in Visual Studio, it dumps hundreds of megabytes of intermediate files into bin and obj folders that never get cleared. Visual Studio’s "Clean Solution" menu item only removes build products that it currently tracks in the active configuration. It leaves behind stale debug symbols, intermediate Roslyn compiler caches, and previous target framework builds forever.

What's Actually Going On

Every project in a Visual Studio solution creates bin/ and obj/ subdirectories that store intermediate compiler artifacts, PDB debug symbols, and uncompressed DLLs.

Over a year of development, a repository that is only 200MB of source code can expand to 15GB of unneeded intermediate build files.

Additionally, Visual Studio caches offline NuGet packages and installer payloads in C:\ProgramData\Package Cache, consuming another 10GB to 25GB.

How to Recursively Wipe Build Artifacts Safely

1. Recursively Delete bin and obj in Solution Directories

Run a PowerShell one-liner scoped strictly inside your source code folder. This removes intermediate build products while leaving your project files and code intact.

powershell
Get-ChildItem -Path "$HOME\source\repos" -Include bin,obj -Recurse | Where-Object { $_.PSIsContainer } | Remove-Item -Recurse -Force

Caution: Never run a recursive folder delete looking for "bin" against the root drive C:\. Windows system binaries or external utilities stored in C:\bin will be permanently damaged.

2. Purge Global NuGet Package Cache

Clear out historical NuGet package versions that are no longer referenced by any active solution.

powershell
dotnet nuget locals all --clear

3. Clean the Visual Studio Package Cache

Open Visual Studio Installer, click the More dropdown, and select "Clean up packages" to delete stale installer payloads.

We got tired of doing this manually — that's exactly why we built Orbit.

Orbit Interface Orbit identifies disposable build folders and NuGet caches without command line risks.

One More Thing

You can configure Directory.Build.props at the root of your repository to redirect all bin/ and obj/ outputs to a single centralized out/ directory.

This allows you to purge all build outputs across multiple projects by deleting a single folder.

The Verdict

Use Manual Method if: Use dotnet nuget locals all --clear if you only need a fast NuGet cache purge from the command line.

Use Orbit if: Use Orbit if you want to safely clear bin/obj bloat and package caches across all your project folders in one visual dashboard.

Finding these files too slow?

Orbit visualizes your entire drive — Mac and Windows both — so you see exactly where space is going before you delete anything.

Orbit Interface

Continue Reading