binlog-failure-analysis
GitHub分析 MSBuild 二进制日志以诊断构建失败,支持通过 MCP 服务器或文本回放排查错误、依赖及执行顺序。
Trigger Scenarios
Install
npx skills add dotnet/skills --skill binlog-failure-analysis -g -y
SKILL.md
Frontmatter
{
"name": "binlog-failure-analysis",
"license": "MIT",
"description": "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 FOR: generating binlogs (use binlog-generation), binlog MCP startup or connection failures (use troubleshoot-binlog-mcp), non-MSBuild build systems."
}
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:
- The
.binlogfile is a binary format — do NOT try tocat,head,strings, or read it directly. Use only the MCP tools to query it. - The original source/project files might or might NOT be available on disk. Project files (.csproj, .props, .targets, App.config, etc.) - if you cannot locate them on disk, they can only be read from within the binlog via MCP tools (e.g., embedded/source file retrieval).
- Synthesize findings as you go. Do not spend all available time investigating — once you have enough evidence, present your conclusions. A partial answer with clear reasoning is better than timing out mid-investigation.
Use the available MCP server tools to query the binary log for:
- Build errors and warnings
- MSBuild properties and their values
- MSBuild items (PackageReference, ProjectReference, etc.)
- Project evaluation data
- Target execution details
- File contents embedded in the binlog
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
Version History
-
95e7d0c
Current 2026-11-02 18:37
新增 binlog MCP 启动故障排查流程,增强离线环境下的诊断能力与 PowerShell 兼容性。
-
10d85e2
2026-10-19 01:58
优化了技能指导说明
-
aa3c4ab
2026-08-07 10:01
调整 BinlogMcp 的 NuGet 源配置策略:先恢复为中性源,后重新指定使用 dnceng dotnet-public feed 以确保确定性解析,并修复了相关配置文件中的过时源名称。
- ce75c35 2026-07-06 00:31


