Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Guide for diagnosing and improving MSBuild project evaluation performance. USE FOR: builds slow before any compilation starts, high evaluation time in binlog analysis, expensive glob patterns walking large directories (node_modules, .git, bin/obj), deep import chains (>20 levels), preprocessed output >10K lines indicating heavy evaluation, property functions with file I/O ($([System.IO.File]::ReadAllText(...))), multiple evaluations per project. Covers the 5 MSBuild evaluation phases, glob optim
| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-05 | ✗→✓ | ▲ Improved | 22% | 0% |
| case-03 | ✗→✓ | ▲ Improved | 4% | 0% |
| case-07 | ✗→✓ | ▲ Improved | 7% | 0% |
| case-08 | ✗→✓ | ▲ Improved | 112% | 0% |
| case-10 | ✗→✓ | ▲ Improved | 14% | 0% |
Evaluation is the work MSBuild does before any target runs — reading project files, processing imports, expanding globs. This skill helps you find and confirm evaluation bottlenecks. Measure first; recommend a change only when a measurement proves it is warranted.
Engage only when evaluation is measurably the bottleneck. Do NOT act when:
That is not an evaluation problem — use build-perf-diagnostics instead.
incremental-build instead.
is slow, gather one first (see below). Do not guess from reading project files.
imports, or EnableDefaultItems are only worth flagging when the numbers show they cost real time. A project that evaluates quickly needs no change.
When a pattern is present but unmeasured, report it as an observation and let the user decide — do not rewrite working configuration to match a "best practice" without evidence it costs measurable evaluation time. Prefer the smallest, most targeted change; never disable SDK defaults as a first move.
For a comprehensive overview of MSBuild's evaluation and execution model, see Build process overview.
<Import>, evaluate <PropertyGroup> top-to-bottom<ItemDefinitionGroup> metadata defaults<ItemGroup> with Include, Remove, Update, glob expansionKey insight: evaluation happens BEFORE any targets run. Slow evaluation = slow build start even when nothing needs compiling.
Use the binlog MCP server (Microsoft.AITools.BinlogMcp, exposed under the binlog MCP namespace) to analyze evaluation performance:
dotnet msbuild build.binlog -noconlog -fl -flp:v=diag;logfile=full.loggrep -i 'Evaluation started\|Evaluation finished' full.logdotnet msbuild -pp:full.xml MyProject.csprojOnly pursue these remedies once a measurement shows item evaluation is slow and the globs are the cause; a custom glob that isn't walking large trees is fine.
**/*.cs walk the entire directory treenode_modules/, .git/, bin/, obj/ — millions of files<DefaultItemExcludes> to exclude large directoriessrc/**/*.cs instead of **/*.cs<EnableDefaultItems>false</EnableDefaultItems> only as a last resort (loses SDK defaults) — prefer the two options above first/pp output → search for <!-- Importing comments to see import treegrep 'Evaluation started.*ProjectName' full.log → if count > 1, check for differing global properties/graph)$([System.IO.File]::ReadAllText(...)) during evaluation — reads file on every evaluationdotnet msbuild -pp:full.xmlOther measured skills in the registry, with their headline benchmark lift.