binlog-generation

Generate MSBuild binary logs for dotnet build, test, pack, publish, and restore commands.

Updated Jul 12, 2026
One-click install
npx skills add https://github.com/Patrick-Rex/DotNetTechSamples --skill binlog-generation-patrick-rex
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: binlog-generation
Source: https://github.com/Patrick-Rex/DotNetTechSamples/tree/main/.agents/plugins/dotnet-msbuild/skills/binlog-generation
Command: npx skills add https://github.com/Patrick-Rex/DotNetTechSamples --skill binlog-generation-patrick-rex

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Build failures and performance regressions in .NET projects are hard to diagnose after the fact because console output lacks the full execution detail. This Skill ensures every MSBuild invocation captures a binary log (binlog) so failures and slowdowns can be investigated without re-running the build. ## Core Features & Use Cases - Automatic binlog capture: Adds the /bl:{} flag to dotnet build, test, pack, publish, restore, and msbuild commands so each run produces a uniquely named binary log. - Shell-specific guidance: Provides the correct escaping for PowerShell (-bl:{{}}) versus bash/cmd, plus fallback naming when the {} placeholder is unavailable. - Build history preservation: Instructs to verify binlog creation and exclude *.binlog files from git clean so diagnostic history survives repository cleanup. - Use Case: A CI build fails intermittently. Because every build ran with /bl:{}, the exact failing build's binlog already exists and can be opened directly for failure analysis instead of reproducing the issue. ## Quick Start Add the /bl:{} flag to my dotnet build command and verify that a .binlog file was produced afterward.

Frequently Asked Questions about binlog-generation

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate a binlog for dotnet build?

Add the /bl:{} flag to the command, for example dotnet build /bl:{}. MSBuild replaces the {} placeholder with a unique identifier so every build produces a distinct .binlog file that never overwrites previous logs.

How to create MSBuild binary logs in PowerShell?

In PowerShell, escape the braces by writing dotnet build -bl:{{}}. The doubled braces are required because PowerShell interprets single braces, and the result still produces a uniquely named binlog per invocation.

Which MSBuild version supports the {} binlog placeholder?

The {} placeholder requires MSBuild 17.8 or later, which ships with the .NET 8 SDK. On older versions, specify an explicit filename such as /bl:4.binlog after checking existing files to avoid collisions.

Why is no binlog file created after my build?

A build that fails before MSBuild starts, such as one with an invalid argument, writes no binlog. Verify creation afterward with ls *.binlog, dir /b *.binlog, or Get-ChildItem *.binlog depending on your shell.

Does git clean delete binlog files?

Yes, git clean -fdx deletes binlog files because they are typically listed in .gitignore. Use git clean -fdx -e "*.binlog" to exclude them and preserve build history for later failure or performance analysis.