check-bin-obj-clash
What it does
This skill finds MSBuild projects whose output or intermediate folders overlap, which can cause builds to fail or overwrite files. It is for developers seeing file-in-use errors or intermittent build failures.
When to use it
- ✓When a build fails with a message about a file already existing or being in use.
- ✓When builds fail sometimes but succeed on retry.
- ✓When outputs are missing or overwritten in a solution with several projects.
Skill link
https://github.com/dotnet/skills/blob/main/plugins/dotnet-msbuild/skills/check-bin-obj-clash/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
“My solution build fails with a file already exists error during restore. Find which projects share a folder.”
5 new skills a week. 1 minute to read.
How it works
The agent checks the output and intermediate folder settings of each project, looks for overlaps, and reports which projects clash and why.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
Detecting OutputPath and IntermediateOutputPath Clashes
Overview
This skill helps identify when multiple MSBuild project evaluations share the same OutputPath or IntermediateOutputPath. This is a common source of build failures including:
- File access conflicts during parallel builds
- Missing or overwritten output files
- Intermittent build failures
- "File in use" errors
- NuGet restore errors like
Cannot create a file when that file already exists- this strongly indicates multiple projects share the sameIntermediateOutputPathwhereproject.assets.jsonis written
Clashes can occur between:
- Different projects sharing the same output directory
- Multi-targeting builds (e.g.,
TargetFrameworks=net8.0;net9.0) where the path doesn't include the target framework - Multiple solution builds where the same project is built from different solutions in a single build
Note: Project instances with BuildProjectReferences=false should be ignored when analyzing clashes - these are P2P reference resolution builds that only query metadata (via GetTargetPath) and do not actually write to output directories.
When to Use This Skill
Invoke this skill immediately when you see:
Cannot create a file when that file already existsduring NuGet restoreThe process cannot access the file because it is being used by another process- Intermittent build failures that succeed on retry
- Missing output files or unexpected overwriting
Step 1: Generate a Binary Log
Use the binlog-generation skill to generate a binary log with the correct naming convention.
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. - Synthesize findings as you go. Do not spend all available time investigating — once you have enough evidence, present your conclusions.
Step 2: Get an overview and list projects
Use the MCP overview and projects tools to understand the build and list all projects that participated.
Step 3: Check evaluations and global properties
Use the MCP evaluations and evaluation_global_properties tools to find all evaluations per project. Look for:
- Multiple evaluations for the same project (indicates multi-targeting or multiple build configurations)
- Differing global properties between evaluations (
TargetFramework,Configuration,RuntimeIdentifier,SolutionFileName,PublishReadyToRun, etc.)
Step 4: Get output paths for each evaluation
Use the MCP properties tool to query OutputPath, IntermediateOutputPath, BaseOutputPath, and BaseIntermediateOutputPath for each project evaluation.
Step 5: Check for double writes
Use the MCP double_writes tool if available — it directly detects files written by multiple project instances.
Step 6: Identify clashes
Compare the OutputPath and IntermediateOutputPath values across all evaluations:
- Normalize paths - Convert to absolute paths and normalize separators
- Group by path - Find evaluations that share the same OutputPath or IntermediateOutputPath
- Filter out non-build evaluations - Exclude
BuildProjectReferences=falseinstances (P2P queries) - Report clashes - Any group with more than one evaluation indicates a clash
Fallback workflow — text-log replay (when MCP is unavailable)
Use this only when the MCP server cannot be started.
Replay the binlog to a diagnostic text log, then grep for the same signals the MCP tools surface:
dotnet msbuild build.binlog -noconlog -fl "-flp:v=diag;logfile=full.log"
Then extract the clash signals:
- Projects & evaluations — list evaluation starts and count them per project:
grep 'Evaluation started' full.log | grep -oiE '"[^"]+\.[a-z]+proj"' | sort | uniq -c. Matching the full quoted path keeps same-named projects in different directories distinct (and tolerates spaces in paths); a path with a count ≥ 2 was evaluated more than once (multi-targeting or extra global properties). (grep -calone only totals evaluations across the whole log, so it can't reveal per-project duplication.) - Output paths — `gr
FAQ
What error does it help with?
It helps with errors such as a file being in use or a file already existing during restore.
Does it change my project files?
It reports the clash, and changes are made after you review them.
Does it cover multi-targeting?
Yes. Multi-targeted builds can also cause clashes without the framework in the path.
Details
Original description by the author
Detects MSBuild projects with conflicting OutputPath or IntermediateOutputPath. USE FOR: builds failing with 'Cannot create a file when that file already exists', 'The process cannot access the file because it is being used by another process', intermittent build failures that succeed on retry, or missing/overwritten outputs in multi-project or multi-targeting builds where bin/obj (or project.assets.json) collide. Common causes: shared OutputPath, missing AppendTargetFrameworkToOutputPath, extra global properties (e.g. PublishReadyToRun), or SetTargetFramework on a ProjectReference to a single
repo: dotnet/skills
Popularity
- GitHub stars
- 5.8k
- Ranking position
- #14595
- 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.