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
- Cache obj/ and bin/ directories keyed on the project files and lockfile
- Enable MSBuild node reuse within the job
- 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.
Related
How to make Windows CI fasterWindows jobs take three times as long as the equivalent Linux jobs.Installing Visual Studio components in CIA required VS workload is missing and installing it takes fifteen minutes.How to sign Windows binaries in CIAuthenticode signing needs a certificate that must not be exposed.How to parallelise .NET tests.NET tests run serially and take twenty minutes.