build-parallelism

Diagnose and fix under-parallelized MSBuild builds using binlog analysis and dependency graph optimization.

Updated Sep 22, 2026
One-click install
npx skills add https://github.com/bytecakelake/Nurse-Scheduler --skill build-parallelism-bytecakelake
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: build-parallelism
Source: https://github.com/bytecakelake/Nurse-Scheduler/tree/main/.agents/plugins/dotnet-msbuild/skills/build-parallelism
Command: npx skills add https://github.com/bytecakelake/Nurse-Scheduler --skill build-parallelism-bytecakelake

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Multi-project .NET solution builds often stay slow even with many CPU cores because MSBuild defaults to sequential execution and long serial ProjectReference chains block parallelization. This Skill helps you find why -m isn't speeding up your build and how to fix it. ## Core Features & Use Cases - Critical Path Analysis: Read binlog per-project timings to identify the longest serial dependency chain (e.g., Core → Api → Web → Tests) that limits minimum build time. - Parallelism Configuration: Guidance on /maxcpucount (-m), graph build mode (/graph), BuildInParallel, and multi-threaded MSBuild tasks. - Reference Optimization: Flatten false dependencies with ReferenceOutputAssembly="false", convert ProjectReferences to PackageReferences, and use solution filters (.slnf) to build subsets. - Use Case: Your CI build pegs one core while others idle. Use this Skill to confirm -m is passed, replay the binlog with performancesummary, find the serial chain, and break unnecessary ProjectReference edges so independent projects build concurrently. ## Quick Start Rebuild my solution with dotnet build -m /bl and analyze the binlog to find why my build isn't parallelizing across cores.

Frequently Asked Questions about build-parallelism

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
Why is my dotnet build slow even with multiple CPU cores?▼

MSBuild defaults to /maxcpucount of 1, so builds run sequentially unless you pass -m. Even with -m, a long serial ProjectReference chain (the critical path) forces projects to wait on predecessors, so extra cores sit idle.

How do I find the critical path in an MSBuild build?▼

Build with dotnet build -m /bl to produce a binlog, then read per-project timings via the binlog MCP expensive_projects tool or replay with performancesummary. If total build time roughly equals the sum of one dependency chain's project times, that chain is the bottleneck.

What does msbuild /graph do and when should I use it?▼

The /graph flag makes MSBuild construct the full project dependency graph before building, enabling better scheduling, fewer redundant evaluations, and isolated builds. Use it for large solutions and CI builds, but avoid it when projects dynamically discover references at build time.

How do I reduce unnecessary ProjectReference dependencies?▼

Set ReferenceOutputAssembly="false" on references needed only for build ordering, use SkipGetTargetFrameworkProperties="true" to skip extra evaluations, and convert references to pre-built PackageReferences where possible. Solution filters (.slnf) let you build only subsets of the solution.

When should I not use build parallelism diagnostics?▼

Skip this approach for single-project builds, incremental build issues, or slow compilation inside one project, which need different diagnostics. It also does not apply to non-MSBuild build systems.