Binlog failure analysis

From managedcode/dotnet-skills · View interactive version

Binlog failure analysis is an AI agent skill from the GitHub repository managedcode/dotnet-skills. Analyze MSBuild binary logs to diagnose build failures. USE FOR: build errors that are unclear from console output, diagnosing cascading failures across multi-project builds, tracing MSBuild target execution order, and generally any MSBuild build issues. Requires an existing .binlog file. DO NOT USE

How to use this skill

Skill file

Analyzing MSBuild Failures with Binary Logs

This skill diagnoses MSBuild build failures from a .binlog file. The preferred

path uses the binlog MCP server (Microsoft.AITools.BinlogMcp, exposed under the

binlog MCP namespace) which is bundled with this plugin. If the MCP server is

not available, use troubleshoot-binlog-mcp to diagnose startup when repair is wanted.

If repair is blocked, declined, or unnecessary for this task, continue with the

binlog replay workflow at the bottom.

Primary workflow — binlog MCP

The MCP server exposes structured tools for inspecting a .binlog without

parsing text logs. Call them directly instead of replaying the binlog to a text

file. Call tools/list for the MCP first if you are unsure which tools are available.

Important constraints:

Use the available MCP server tools to query the binary log for:

Fallback workflow — text-log replay (when MCP is unavailable)

Use this only when the MCP server cannot be started (for example, on an older

SDK or in an offline environment).

Replay the binlog to text logs

dotnet msbuild build.binlog -noconlog \
  -fl  "-flp:v=diag;logfile=full.log;performancesummary" \
  -fl1 "-flp1:errorsonly;logfile=errors.log" \
  -fl2 "-flp2:warningsonly;logfile=warnings.log"

PowerShell note: Use -flp:"v=diag;logfile=full.log;performancesummary"

(quoted semicolons).

Search the text logs

cat errors.log
grep -n -B2 -A2 "CS0246" full.log
grep -i "CoreCompile.*FAILED\|Build FAILED\|error MSB" full.log
grep 'Target "CoreCompile"' full.log | grep -oP 'project "[^"]*"'

Generating a binlog (only if none exists)

dotnet build /bl:build.binlog
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.