binlog-generation
What it does
This skill adds the binary log switch to .NET build commands so every build leaves a detailed record. It is for developers who want to investigate build errors or slowness after the build has run.
When to use it
- βWhen you run a .NET build, test, pack, publish or restore and want a record of it.
- βWhen a build fails and you want to investigate it without rerunning it.
- βWhen you want to compare builds before and after a change.
Skill link
https://github.com/dotnet/skills/blob/main/plugins/dotnet-msbuild/skills/binlog-generation/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agentβs skills folder.
Example of what to ask your AI
βRun my .NET tests with a binary log so I can investigate any failures afterward.β
5 new skills a week. 1 minute to read.
How it works
The agent adds the log switch to the command with a unique file name, so each build keeps its own record and no earlier log is overwritten.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
Generate Binary Logs
Pass the /bl switch when running any MSBuild-based command. This is a non-negotiable requirement for all .NET builds.
Commands That Require /bl
You MUST add the /bl:{} flag to:
dotnet builddotnet testdotnet packdotnet publishdotnet restoremsbuildormsbuild.exe- Any other command that invokes MSBuild
Preferred: Use {} for Automatic Unique Names
Note: The
{}placeholder requires MSBuild 17.8+ / .NET 8 SDK or later.
The {} placeholder in the binlog filename is replaced by MSBuild with a unique identifier, guaranteeing no two builds ever overwrite each other β without needing to track or check existing files.
# Every invocation produces a distinct file automatically
dotnet build /bl:{}
dotnet test /bl:{}
dotnet build --configuration Release /bl:{}
PowerShell requires quoting the complete switch:
# Keep the literal {} placeholder in one argument
dotnet build '-bl:{}'
dotnet test '-bl:{}'
Why This Matters
- Unique names prevent overwrites - You can always go back and analyze previous builds
- Failure analysis - When a build fails, the binlog is already there for immediate analysis
- Comparison - You can compare builds before and after changes
- No re-running builds - You never need to re-run a failed build just to generate a binlog
Examples
# β
CORRECT - {} generates a unique name automatically (bash/cmd)
dotnet build /bl:{}
dotnet test /bl:{}
# β
CORRECT - quote the complete PowerShell argument
dotnet build '-bl:{}'
dotnet test '-bl:{}'
# β WRONG - Missing /bl flag entirely
dotnet build
dotnet test
# β WRONG - No filename (overwrites the same msbuild.binlog every time)
dotnet build /bl
dotnet build /bl
One build = one binlog
Add /bl:{} to every MSBuild invocation separately β never reuse a name and
never rely on bare /bl:
- Building several configurations, projects, or retrying a failed build? Each
command still gets its own
/bl:{}so the logs never overwrite each other.
dotnet build -c Debug /bl:{} # unique file
dotnet build -c Release /bl:{} # another unique file
Verify the binlog exists
After the build, confirm a .binlog was actually produced before moving on to
analysis β a build that fails before MSBuild starts (e.g. a bad argument)
writes no binlog:
ls -1 *.binlog # bash
dir /b *.binlog # Windows cmd
Get-ChildItem *.binlog # PowerShell
Note the resulting path so binlog-failure-analysis or build-perf-diagnostics
can consume it.
When a Specific Filename Is Required
If the binlog filename needs to be known upfront (e.g., for CI artifact upload), or if {} is not available in the installed MSBuild version, pick a name that won't collide with existing files:
- Check for existing
*.binlogfiles in the directory - Choose a name not already taken (e.g., by incrementing a counter from the highest existing number)
# Example: directory contains 3.binlog β use 4.binlog
dotnet build /bl:4.binlog
Cleaning the Repository
When cleaning the repository with git clean, always exclude binlog files to preserve your build history:
# β
CORRECT - Exclude binlog files from cleaning
git clean -fdx -e "*.binlog"
# β WRONG - This deletes binlog files (they're usually in .gitignore)
git clean -fdx
This is especially important when iterating on build fixes - you need the binlogs to analyze what changed between builds.
FAQ
Why use a unique file name?
Each build gets its own name, so previous logs are never overwritten.
Which version is needed for the unique name?
The unique name needs MSBuild 17.8 or later, which comes with .NET 8 SDK and newer.
Does it analyze the log?
No. Analysis is handled by a separate skill.
Details
Original description by the author
Generate MSBuild binary logs (binlogs) for build diagnostics and analysis. USE FOR: adding /bl:{} to any dotnet build, test, pack, publish, or restore command to capture a full build execution trace, prerequisite for binlog-failure-analysis and build-perf-diagnostics skills, enabling post-build investigation of errors or performance. Requires MSBuild 17.8+ / .NET 8 SDK+ for {} placeholder; PowerShell must quote the complete switch as '-bl:{}'. DO NOT USE FOR: non-MSBuild build systems (npm, Maven, CMake), analyzing an existing binlog (use binlog-failure-analysis instead), binlog MCP startup fa
repo: dotnet/skills
Popularity
- GitHub stars
- 5.8k
- Ranking position
- #14591
- License
- MIT
- Updated
- 11/2/2026
Comments
- β¦
More skills from this repository
create-custom-agent
5.8kHelps your agent create VS Code custom agent files with their own tools, instructions and handoffs to other agents.
create-skill
5.8kHelps your agent create a new agent skill with a valid name, a clear trigger description and a SKILL.md file that follows the standard.
csharp-scripts
5.8kHelps your agent run a small C# program as a single file with the .NET command line tool, without creating a full project.
dotnet-pinvoke
5.8kHelps your agent call native C or C++ libraries from .NET correctly, covering signatures, string handling, memory and safe handles.
Similar skills
openclaw-update
394kHelps your agent update an existing OpenClaw Gateway, choosing the update method that fits how it was installed and keeping your session working.
diagnose-gateway
394kHelps your agent find out why your OpenClaw Gateway is failing by checking settings, channels, and ports without changing anything.
crabbox-apps
394kHelps your agent open and run an app on a temporary cloud machine, then show its view in your chat side panel.