Loading...
Loading...
Analyze MSBuild binary logs to diagnose build failures by replaying binlogs to searchable text logs. Only activate in MSBuild/.NET build context. USE FOR: build errors that are unclear from console output, diagnosing cascading failures across multi-project builds, tracing MSBuild target execution order, investigating common errors like CS0246 (type not found), MSB4019 (imported project not found), NU1605 (package downgrade), MSB3277 (version conflicts), and ResolveProjectReferences failures. Requires an existing .binlog file. DO NOT USE FOR: generating binlogs (use binlog-generation), build performance analysis (use build-perf-diagnostics), non-MSBuild build systems. INVOKES: dotnet msbuild binlog replay, grep, cat, head, tail for log analysis.
npx skill4agent add dotnet/skills binlog-failure-analysisgrepcatheadtailfinddotnet msbuild build.binlog -noconlog \
-fl -flp:v=diag;logfile=full.log;performancesummary \
-fl1 -flp1:errorsonly;logfile=errors.log \
-fl2 -flp2:warningsonly;logfile=warnings.logPowerShell note: Use(quoted semicolons).-flp:"v=diag;logfile=full.log;performancesummary"
cat errors.log# Find all occurrences of a specific error code with surrounding context
grep -n -B2 -A2 "CS0246" full.log
# Find which projects failed to compile
grep -i "CoreCompile.*FAILED\|Build FAILED\|error MSB" full.log
# Find project build order and results
grep "done building project\|Building with" full.log | head -50CoreCompile# List all projects that ran CoreCompile
grep 'Target "CoreCompile"' full.log | grep -oP 'project "[^"]*"'
# Compare against projects that had errors to identify cascading failures
grep "project.*FAILED" full.log# Read the .csproj of the failing project
cat path/to/Services/Services.csproj
# Check PackageReference and ProjectReference entries
grep -n "PackageReference\|ProjectReference" path/to/Services/Services.csproj# The PerformanceSummary is at the end of full.log
tail -100 full.log # shows target/task timing summary
grep "Target Performance Summary\|Task Performance Summary" -A 50 full.log# Check evaluation properties
grep -i "OutputPath\|IntermediateOutputPath\|TargetFramework" full.log | head -30
# Check item groups
grep "PackageReference\|ProjectReference" full.log | head -30| Command | Purpose |
|---|---|
| Full diagnostic log with perf summary |
| Errors only |
| Warnings only |
| Search for patterns in the replayed log |
| Preprocess — inline all imports into one file |
dotnet build /bl:build.binlog