Binlog Generation
.NET (Microsoft)OfficialPublished by .NET (Microsoft)
- Skill
- Tool integration
- Software development
- MIT
- No issues found
AutoGineer summary
Written by AutoGineer from the skill’s own files, not by the author
This skill provides instructions on using the /bl switch with MSBuild-based commands to capture comprehensive build execution traces. By utilizing the {} placeholder, users can automatically generate unique binary logs for every build invocation, ensuring that diagnostic data is preserved for failure analysis and performance comparisons without manual file management.
What it does
- Explains how to append the /bl:{} switch to dotnet build, test, pack, and publish commands.
- Details the use of the {} placeholder for automatic, unique filename generation.
- Provides specific syntax requirements for PowerShell users to ensure the switch is correctly interpreted.
- Offers guidance on verifying the creation of binlog files after a build process.
- Advises on how to manage binlog files during repository cleanup to preserve build history.
When to use it
- Whenever you need to capture a full execution trace of an MSBuild-based build.
- Before running failure analysis or performance diagnostics on a .NET project.
- When you want to avoid overwriting previous build logs during iterative development.
- When you need to compare build behavior across different configurations or code changes.
Advantages
- Prevents log overwrites by generating unique filenames automatically.
- Ensures diagnostic data is immediately available for analysis upon build failure.
- Eliminates the need to re-run builds specifically to capture logs.
- Facilitates easy comparison between different build runs.
Usage examples
- “How do I generate a unique binlog for my dotnet build command?”
- Use 'dotnet build /bl:{}' in your terminal. The {} placeholder will automatically generate a unique filename for the build trace.
- “How do I use the binlog switch in PowerShell?”
- In PowerShell, you must quote the switch to ensure it is passed correctly: 'dotnet build '-bl:{}''.
Install
Download the skill as a ZIP:
https://autogineer.com/agent-skills/dotnet/binlog-generation/downloadUnzip it into the cross-client skills folder of your project:
mkdir -p .agents/skills && unzip binlog-generation.zip -d .agents/skills
Documentation by .NET (Microsoft)
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.exeAny 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 /blOne 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 fileVerify 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 cmdGet-ChildItem *.binlog # PowerShellNote 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 directoryChoose 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.binlogCleaning 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 -fdxThis is especially important when iterating on build fixes - you need the binlogs to analyze what changed between builds.
Files
- ATTRIBUTION.mdAdded by AutoGineer848 B
- LICENSELicence file added by AutoGineer1.1 KiB
- SKILL.md4.2 KiB
LICENSE
The MIT License (MIT) Copyright (c) .NET Foundation and Contributors All rights reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Requirements and compatibility
Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta
“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.
Needs: Needs a command-line tool
Security
No issues found by our static scan· No issues found
A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.
Attribution and licence
- Published by
- .NET (Microsoft)
- Publisher
- .NET (Microsoft) (Official)
- Source
- dotnet/skills · plugins/dotnet-msbuild/skills/binlog-generation · commit 96c3d68
- Licence
- MIT License (redistribution allowed)
- LICENSE (added by AutoGineer from LICENSE)
- ATTRIBUTION.md (written by AutoGineer)
- Synced
AutoGineer is not affiliated with or endorsed by .NET (Microsoft) or .NET (Microsoft).
Download ZIP
The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download binlog-generation.zip