Skip to content

Guides

How to cache MSBuild output

Every build recompiles all projects.

5 min read

Every build recompiles all projects.

Why it happens

Intermediate output directories are not preserved and MSBuild cannot do an incremental build.

How to fix it

  1. Cache obj/ and bin/ directories keyed on the project files and lockfile
  2. Enable MSBuild node reuse within the job
  3. Use --no-restore on build after an explicit restore step

Your next build could be twice as fast, at half the price

Start free. Migrating away is the same one line, and we publish that diff too.