Agent Skillsmanagedcode/dotnet-skills › binlog-failure-analysis

binlog-failure-analysis

GitHub

通过MSBuild二进制日志诊断构建失败,支持MCP工具或文本回放方式分析错误、属性及执行顺序。

catalog/Tools/Official-DotNet-MSBuild/skills/binlog-failure-analysis/SKILL.md managedcode/dotnet-skills

Trigger Scenarios

MSBuild构建报错且控制台信息不足 需要排查多项目级联构建故障 分析MSBuild目标执行顺序

Install

npx skills add managedcode/dotnet-skills --skill binlog-failure-analysis -g -y
More Options

Non-standard path

npx skills add https://github.com/managedcode/dotnet-skills/tree/main/catalog/Tools/Official-DotNet-MSBuild/skills/binlog-failure-analysis -g -y

Use without installing

npx skills use managedcode/dotnet-skills@binlog-failure-analysis

指定 Agent (Claude Code)

npx skills add managedcode/dotnet-skills --skill binlog-failure-analysis -a claude-code -g -y

安装 repo 全部 skill

npx skills add managedcode/dotnet-skills --all -g -y

预览 repo 内 skill

npx skills add managedcode/dotnet-skills --list

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), 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, fall back to 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 .binlog file is a binary format — do NOT try to cat, 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

  • 0559476 Current 2026-08-19 23:39
  • 7ab7f03 2026-07-25 05:27

Same Skill Collection

catalog/Frameworks/gRPC/skills/grpc/SKILL.md
catalog/Frameworks/Official-Astro/skills/astro-developer/SKILL.md
catalog/Frameworks/Official-DotNet-ASPNetCore/skills/configuring-opentelemetry-dotnet/SKILL.md
catalog/Frameworks/Official-DotNet-ASPNetCore/skills/dotnet-webapi/SKILL.md
catalog/Frameworks/Official-DotNet-ASPNetCore/skills/minimal-api-file-upload/SKILL.md
catalog/Frameworks/Orleans/skills/orleans/SKILL.md
catalog/Frameworks/ThreeJS-WebGPU-TSL/skills/webgpu-threejs-tsl/SKILL.md
catalog/Libraries/Official-DotNet-Data/skills/optimizing-ef-core-queries/SKILL.md
catalog/Platform/Official-DotNet-Advanced/skills/csharp-scripts/SKILL.md
catalog/Platform/Official-DotNet-Advanced/skills/nuget-trusted-publishing/SKILL.md
catalog/Platform/Official-DotNet-Blazor/skills/create-blazor-project/SKILL.md
catalog/Platform/Official-DotNet-Blazor/skills/fetch-and-send-data/SKILL.md
catalog/Platform/Official-DotNet-Blazor/skills/support-prerendering/SKILL.md
catalog/Platform/Official-DotNet-Blazor/skills/use-js-interop/SKILL.md
catalog/Platform/Official-DotNet-Experimental/skills/exp-mock-usage-analysis/SKILL.md
catalog/Platform/Official-DotNet-Experimental/skills/exp-simd-vectorization/SKILL.md
catalog/Platform/Official-DotNet-Test-Migration/skills/migrate-xunit-to-mstest/SKILL.md
catalog/Platform/Official-DotNet-Test-Migration/skills/migrate-xunit-to-xunit-v3/SKILL.md
catalog/Platform/Official-DotNet-Upgrade/skills/dotnet-aot-compat/SKILL.md
catalog/Testing/Official-DotNet-Test/skills/code-testing-extensions/SKILL.md
catalog/Testing/Official-DotNet-Test/skills/filter-syntax/SKILL.md
catalog/Testing/Official-DotNet-Test/skills/find-untested-sources/SKILL.md
catalog/Testing/Official-DotNet-Test/skills/platform-detection/SKILL.md
catalog/Testing/Official-DotNet-Test/skills/scaffold-dotnet-test-project/SKILL.md
catalog/Testing/Official-DotNet-Test/skills/test-gap-analysis/SKILL.md
catalog/Testing/Official-DotNet-Test/skills/testability-obstacle/SKILL.md
catalog/Testing/Playwright/skills/playwright-visual-testing/SKILL.md
catalog/Testing/xUnit/skills/xunit/SKILL.md
catalog/Tools/Code-Analysis/skills/code-analysis/SKILL.md
catalog/Tools/HTMLHint/skills/htmlhint/SKILL.md
catalog/Tools/Official-DotNet-Diagnostics/skills/analyzing-dotnet-performance/SKILL.md
catalog/Tools/Official-DotNet-Diagnostics/skills/clr-activation-debugging/SKILL.md
catalog/Tools/Official-DotNet-Diagnostics/skills/dotnet-trace-collect/SKILL.md
catalog/Tools/Official-DotNet-Diagnostics/skills/dump-collect/SKILL.md
catalog/Tools/Official-DotNet-MSBuild/skills/copy-to-output-directory/SKILL.md
catalog/Tools/Official-DotNet-MSBuild/skills/msbuild-server/SKILL.md
catalog/Tools/Official-DotNet-MSBuild/skills/resolve-project-references/SKILL.md
catalog/Tools/ReportGenerator/skills/reportgenerator/SKILL.md
catalog/Tools/ReSharper-CLT/skills/resharper-clt/SKILL.md
catalog/Tools/Roslynator/skills/roslynator/SKILL.md
catalog/Tools/Stylelint/skills/stylelint/SKILL.md
external-sources/upstreams/webgpu-claude-skill/skills/webgpu-threejs-tsl/SKILL.md
catalog/Frameworks/ASP.NET-Core/skills/aspnet-core/SKILL.md
catalog/Frameworks/Aspire/skills/aspire/SKILL.md
catalog/Frameworks/Azure-Functions/skills/azure-functions/SKILL.md
catalog/Frameworks/Blazor/skills/blazor/SKILL.md
catalog/Frameworks/Entity-Framework-6/skills/entity-framework6/SKILL.md
catalog/Frameworks/Entity-Framework-Core/skills/entity-framework-core/SKILL.md
catalog/Frameworks/MAUI/skills/maui/SKILL.md

Metadata

Files
0
Version
0559476
Hash
3e14a71a
Indexed
2026-07-25 05:27

inicio - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-20 05:28
浙ICP备14020137号-1 $mapa de visitantes$