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 m…
Install / Use
npx skills add dotnet/skills --skill check-bin-obj-clashInstalls into whichever agent you are using.
SKILL.md
Installable skill definition
Quality Score
Category
Development & EngineeringSupported Platforms
Tags
Our assessment of check-bin-obj-clash
check-bin-obj-clash scores 87/100 on our quality scale, 862nd of 2,398 Development & Engineering skills we index (top 36%).
Its SKILL.md is 21 KB long, well organised into 22 sections with 12 code examples: a thorough specification that gives an agent plenty to work with.
With 5,471 GitHub stars, it is one of the more widely adopted skills in the catalogue.
Maintenance, license and trust
- The repository was last updated 2 days ago, so check-bin-obj-clash is actively maintained.
- It is released under the MIT license, a permissive license that allows use, modification and commercial use with attribution.
- Its trust signals score 100/100, with no cautions. These come from repository metadata, not a code audit — read the skill file before letting an agent act on it.
check-bin-obj-clash compared with similar skills
All 4 of these similar skills score higher than check-bin-obj-clash; compare them before choosing.
| Skill | Score | Stars | Updated | Format |
|---|---|---|---|---|
| check-bin-obj-clash (this skill)by dotnet | 87 | 5.5k | 2d ago | SKILL.md |
| ai-job-searchby MadsLorentzen | 100 | 44.0k | 5d ago | CLAUDE.md |
| claude-howtoby luongnv89 | 100 | 41.7k | today | CLAUDE.md |
| algorithmic-artby anthropics | 100 | 177.9k | 4d ago | SKILL.md |
| pptxby anthropics | 100 | 177.9k | 4d ago | SKILL.md |
Frequently asked questions
- How do I install check-bin-obj-clash?
- Run
npx skills add dotnet/skills --skill check-bin-obj-clash. The install tabs above show the steps for each supported agent. - Which AI agents does check-bin-obj-clash work with?
- It is written for Universal, as a SKILL.md file. Other agents that read the same format can often use it too.
- Is check-bin-obj-clash safe to use?
- It is MIT-licensed and scores 100/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
- Is check-bin-obj-clash still maintained?
- The repository was last updated 2 days ago, so check-bin-obj-clash is actively maintained.
Skill content
View source on GitHubname: check-bin-obj-clash description: "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-targeting project. DO NOT USE FOR: file access errors unrelated to MSBuild (OS-level locking), single-project single-TFM builds, non-MSBuild build systems." license: MIT
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 —
grep -iE 'OutputPath[[:space:]]*=|IntermediateOutputPath[[:space:]]*=|BaseOutputPath[[:space:]]*=|BaseIntermediateOutputPath[[:space:]]*=' full.log | sort -u, or query a project directly:dotnet msbuild MyProject.csproj -getProperty:OutputPath(andIntermediateOutputPath,BaseIntermediateOutputPath). - Distinguishing global properties —
grep -iE 'TargetFramework|Configuration|Platform|RuntimeIdentifier|SolutionFileName|PublishReadyToRun' full.log. See the Global Properties to Check table for which affect the path and which just fork a redundant instance. - Corroborating evidence (optional) —
grep 'Target "CopyFilesToOutputDirectory"' full.logplusgrep 'SkipUnchangedFiles' full.logshow a second instance writing (or skipping a masked write) to the same path; a long vs ~0 msCoreCompiledistinguishes the real build from a redundant instance.
Then identify clashes: normalize paths to absolute, group evaluations by OutputPath and by IntermediateOutputPath, and exclude BuildProjectReferences=false (P2P queries) — plus, for OutputPath only, MSBuildRestoreSessionId restore evaluations. Any group with more than one remaining evaluation is a clash.
Common Causes and Fixes
Multi-targeting without TargetFramework in path
Problem: Project uses TargetFrameworks but OutputPath doesn't vary by framework.
<!-- BAD: Same path for all frameworks -->
<OutputPath>bin\$(Configuration)\</OutputPath>
Fix: Include TargetFramework in the path:
<!-- GOOD: Path varies by framework -->
<OutputPath>bin\$(Configuration)\$(TargetFramework)\</OutputPath>
Or rely on SDK defaults which handle this automatically:
<AppendTargetFrameworkToOutputPath>true</AppendTargetFrameworkToOutputPath>
<AppendTargetFrameworkToIntermediateOutputPath>true</AppendTargetFrameworkToIntermediateOutputPath>
Shared output directory across projects (CANNOT be fixed with AppendTargetFramework)
Problem: Multiple projects explicitly set the same BaseOutputPath or BaseIntermediateOutputPath.
<!-- Project A - Directory.Build.props -->
<BaseOutputPath>..\SharedOutput\</BaseOutputPath>
<BaseIntermediateOutputPath>..\SharedObj\</BaseIntermediateOutputPath>
<!-- Project B - Directory.Build.props -->
<BaseOutputPath>..\SharedOutput\</BaseOutputPath>
<BaseIntermediateOutputPath>..\SharedObj\</BaseIntermediateOutputPath>
IMPORTANT: Even with AppendTargetFrameworkToOutputPath=true, this will still clash! .NET writes certain files directly to the IntermediateOutputPath without the TargetFramework suffix, including:
project.assets.json(NuGet restore output)- Other NuGet-related files
This causes errors like Cannot create a file when that file already exists during parallel restore.
Fix: Each project MUST have a unique BaseIntermediateOutputPath. Do not share intermediate output directories across projects:
<!-- Project A -->
<BaseIntermediateOutputPath>..\obj\ProjectA\</BaseIntermediateOutputPath>
<!-- Project B -->
<BaseIntermediateOutputPath>..\obj\ProjectB\</BaseIntermediateOutputPath>
Or simply use the SDK defaults which place obj inside each project's directory.
RuntimeIdentifier builds clashing
Problem: Building for multiple RIDs without RID in path.
Fix: Ensure RuntimeIdentifier is in the path:
<AppendRuntimeIdentifierToOutputPath>true</AppendRuntimeIdentifierToOutputPath>
Multiple solutions building the same project
Problem: A single build invokes multiple solutions (e.g., via MSBuild task or command line) that include the same project. Each solution build evaluates and builds the project independently, with different Solution* global properties that don't affect the output path.
How to detect: Compare SolutionFileName and CurrentSolutionConfigurationContents across evaluations for the same project. Different values indicate multi-solution builds. For example:
| Property | Eval from Solution A | Eval from Solution B |
|---|---|---|
| SolutionFileName | BuildAnalyzers.sln | Main.slnx |
| CurrentSolutionConfigurationContents | 1 project entry | ~49 project entries |
| OutputPath | bin\Release\netstandard2.0\ | bin\Release\netstandard2.0\ ← clash |
Example: A repo build script builds BuildAnalyzers.sln then Main.slnx, and both solutions include SharedAnalyzers.csproj. Both builds write to bin\Release\netstandard2.0\. The first build compiles; the second skips compilation but still runs CopyFilesToOutputDirectory.
Fix: Options include:
- Consolidate solutions - Ensure each project is only built from one solution in a single build
- Use different configurations - Build solutions with different
Configurationvalues that result in different output paths - Exclude duplicate projects - Use solution filters or conditional project inclusion to avoid building the same project twice
Extra global properties creating redundant project instances
Problem: A project is built multiple times within the same solution due to extra global properties (e.g., PublishReadyToRun=false) that create distinct MSBuild project instances. These properties don't affect output paths but prevent MSBuild from caching results across instances, causing redundant target execution.
How to detect: Compare global properties across evaluations for the same project within the same solution (same SolutionFileName). Look for properties that differ but don't contribute to path differentiation:
| Property | Eval A (from Razor.slnx) | Eval B (from Razor.slnx) |
|---|---|---|
| PublishReadyToRun | (not set) | false |
| OutputPath | bin\Release\netstandard2.0\ | bin\Release\netstandard2.0\ ← clash |
This is particularly wasteful for projects where the extra property has no effect (e.g., PublishReadyToRun on a netstandard2.0 class library that doesn't use ReadyToRun compilation).
Fix: Options include:
- Remove the extra global property - Investigate which parent target/task is injecting the property and prevent it from being passed to projects that don't need it
- Use
RemoveGlobalPropertiesmetadata - OnProjectReferenceitems, useRemoveGlobalProperties="PublishReadyToRun"to strip the property before building the referenced project - Condition the property - Only set the property on projects that actually use it (e.g., only for executable projects, not class libraries)
Explicit <MSBuild> Build/Publish with extra global properties (self or cross-project)
Problem: A target use
Truncated for display — read the full file on GitHub.
Related Skills
ai-job-search
44.0kThe job search that runs on your machine. AI job application framework built on Claude Code: evaluate postings, tailor CVs, write cover letters, prep interviews. Fork it and own it.
claude-howto
41.7kA visual, example-driven guide to Claude Code — from basic concepts to advanced agents, with copy-paste templates that bring immediate value.
algorithmic-art
177.9kCreating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code, generative art, algorithmic art, flow fields, or particle systems.
pptx
177.9kUse this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or presentations; reading, parsing, or extracting text from any .pptx or .potx file (even if the extracted content will be used elsewhere, like in an em…
Languages
Trust signals
From repository metadata: license, adoption, age and documentation. Not a code audit — see the Safety scan above for what the skill file itself contains.
