check-bin-obj-clash

Detects MSBuild projects sharing conflicting OutputPath or IntermediateOutputPath directories.

1|Updated Jun 1, 2026
One-click install
npx skills add https://github.com/D1ssolve/craft-agents --skill check-bin-obj-clash-d1ssolve
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: check-bin-obj-clash
Source: https://github.com/D1ssolve/craft-agents/tree/main/skills/check-bin-obj-clash
Command: npx skills add https://github.com/D1ssolve/craft-agents --skill check-bin-obj-clash-d1ssolve

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? MSBuild builds fail intermittently with errors like "Cannot create a file when that file already exists" or "file is being used by another process" when multiple projects or target frameworks write to the same bin/obj directories. This Skill diagnoses exactly which project evaluations clash and why. ## Core Features & Use Cases - Clash Detection: Compares OutputPath and IntermediateOutputPath across all project evaluations in a binary log to find shared directories. - Root Cause Analysis: Distinguishes clash causes such as multi-targeting without TargetFramework in the path, shared BaseIntermediateOutputPath across projects, multi-solution builds, and redundant global properties like PublishReadyToRun. - Fix Guidance: Provides concrete MSBuild property fixes including AppendTargetFrameworkToOutputPath and per-project intermediate paths. - Use Case: A NuGet restore fails with "Cannot create a file when that file already exists" in a multi-project solution. Use this Skill to inspect the binlog, discover two projects share the same obj directory where project.assets.json is written, and apply the recommended fix. ## Quick Start Analyze my build.binlog file to find which MSBuild projects have conflicting OutputPath or IntermediateOutputPath values and explain how to fix them.

Frequently Asked Questions about check-bin-obj-clash

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I find MSBuild projects sharing the same output path?

Generate a binary log with dotnet msbuild, then query OutputPath and IntermediateOutputPath for each project evaluation using the binlog MCP tools or by replaying the log to text and grepping for property assignments. Any path shared by multiple evaluations indicates a clash.

Why does NuGet restore fail with 'Cannot create a file when that file already exists'?

This error strongly indicates multiple projects share the same IntermediateOutputPath where project.assets.json is written during restore. Each project must have a unique BaseIntermediateOutputPath; AppendTargetFrameworkToOutputPath alone cannot fix cross-project intermediate path clashes.

Does AppendTargetFrameworkToOutputPath fix all output path clashes?

No. It fixes multi-targeting clashes within a single project, but files like project.assets.json are written directly to IntermediateOutputPath without the framework suffix. Cross-project clashes require unique BaseIntermediateOutputPath values per project.

Can I analyze a .binlog file by reading it directly?

No. The .binlog format is binary and cannot be read with cat, head, or strings. Use the binlog MCP server tools to query it, or replay it to a text file with dotnet msbuild build.binlog -noconlog -fl -flp:v=diag.

When should I not use this MSBuild clash detection approach?

Do not use it for file access errors unrelated to MSBuild such as OS-level file locking, single-project single-TFM builds, or non-MSBuild build systems. It specifically diagnoses output path conflicts in .NET build contexts.