check-bin-obj-clash
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
npx skills add dotnet/skills --skill check-bin-obj-clash --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
What it does
Detects MSBuild projects with conflicting OutputPath or IntermediateOutputPath across evaluations, to surface clashes that cause file-in-use or missing/overwritten outputs in multi-project or multi-targeting builds. It guides users to identify when multiple evaluations share the same output directories and how global properties or shared BaseOutputPath/BaseIntermediateOutputPath contribute to clashes. It provides a step-by-step workflow using binary logs and MCP tooling to surface, compare, and report clashes, and offers fixes like ensuring unique intermediate paths or including TargetFramework in OutputPath.
How it works
- Invoke the skill when you see common MSBuild path-related issues (e.g., Cannot create a file when that file already exists, file-in-use errors, or intermittent failures).
- Step 1: Generate a Binary Log with binlog-generation.
- Step 2: Use MCP overview and projects tools to list all participating projects.
- Step 3: Use MCP evaluations and evaluation_global_properties to find per-project evaluations and differing global properties (TargetFramework, Configuration, RuntimeIdentifier, SolutionFileName, PublishReadyToRun, etc.).
- Step 4: Use MCP properties to query OutputPath, IntermediateOutputPath, BaseOutputPath, and BaseIntermediateOutputPath for each evaluation.
- Step 5: If available, use MCP double_writes to detect files written by multiple project instances.
- Step 6: Compare OutputPath and IntermediateOutputPath across evaluations:
- Normalize paths to absolute form
- Group by path
- Exclude BuildProjectReferences=false evaluations
- Report any group with more than one evaluation as a clash
- Fallback: If MCP is unavailable, replay the binlog to a diagnostic text log and grep signals for evaluations, OutputPath/IntermediateOutputPath, and global properties; identify clashes similarly and exclude non-build evaluations.
When to use it
Use immediately when you encounter build failures or intermittent failures tied to file access or missing outputs, especially in multi-project or multi-targeting scenarios where bin/obj or project.assets.json may collide.
What it can touch
- The workflow references tools for querying binlogs via MCP (tools/list, evaluations, evaluation_global_properties, properties, double_writes). It does not modify source files or perform builds; it analyzes build metadata produced by prior steps.
Caveats
- Requires binary logs and MCP tooling to be available; the fallback relies on text-log replay if MCP is unavailable. Do not rely on MCP when it cannot be started. The skill describes how to distinguish same-project vs cross-project publish scenarios and how to interpret global properties in relation to paths.
# 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 same `IntermediateOutputPath` where `project.assets.json` is 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 ski
- Overview
- When to Use This Skill
- Step 1: Generate a Binary Log
- Primary workflow — binlog MCP
- Step 2: Get an overview and list projects
- Step 3: Check evaluations and global properties
- Step 4: Get output paths for each evaluation
- Step 5: Check for double writes
- Step 6: Identify clashes
- Fallback workflow — text-log replay (when MCP is unavailable)
- Common Causes and Fixes
- Multi-targeting without TargetFramework in path
- RuntimeIdentifier builds clashing
- Multiple solutions building the same project
dotnet msbuild build.binlog -noconlog -fl -flp:v=diag;logfile=full.log
What does the check-bin-obj-clash skill do?
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
How do I install it?
Run `npx skills add dotnet/skills --skill check-bin-obj-clash --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From dotnet/skills, a repository with 4,927 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.