본문으로 건너뛰기
Skillpedia
배포 및 클라우드 (DevOps)5.8k · #14595

check-bin-obj-clash

하는 일

이 스킬은 출력 폴더나 중간 폴더가 겹치는 MSBuild 프로젝트를 찾습니다. 겹치면 빌드가 실패하거나 파일이 덮어써질 수 있습니다. 파일 사용 중 오류나 간헐적인 빌드 실패를 보는 개발자를 위한 스킬입니다.

사용하는 경우

  • ✓빌드가 파일이 이미 있다거나 사용 중이라는 메시지로 실패할 때.
  • ✓빌드가 가끔 실패하지만 다시 실행하면 성공할 때.
  • ✓여러 프로젝트가 있는 솔루션에서 출력이 없어지거나 덮어써질 때.

스킬 링크

https://github.com/dotnet/skills/blob/main/plugins/dotnet-msbuild/skills/check-bin-obj-clash/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/dotnet/skills/blob/main/plugins/dotnet-msbuild/skills/check-bin-obj-clash/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“제 솔루션 빌드가 복원 중에 파일이 이미 존재한다는 오류로 실패합니다. 어떤 프로젝트가 폴더를 공유하는지 찾아 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

에이전트가 각 프로젝트의 출력과 중간 폴더 설정을 확인하고, 겹치는 부분을 찾아, 어떤 프로젝트가 왜 충돌하는지 보고합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 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 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 skill immediately when you see:

  • Cannot create a file when that file already exists during NuGet restore
  • The 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 .binlog file is a binary format — do NOT try to cat, 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:

  1. Normalize paths - Convert to absolute paths and normalize separators
  2. Group by path - Find evaluations that share the same OutputPath or IntermediateOutputPath
  3. Filter out non-build evaluations - Exclude BuildProjectReferences=false instances (P2P queries)
  4. 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 -c alone only totals evaluations across the whole log, so it can't reveal per-project duplication.)
  • Output paths — `gr
자주 묻는 질문

어떤 오류에 도움이 되나요?

복원 중 파일이 사용 중이거나 이미 존재하는 등의 오류에 도움이 됩니다.

프로젝트 파일을 바꾸나요?

충돌을 보고하며, 변경은 검토한 뒤 적용합니다.

다중 타깃 빌드도 다루나요?

네. 다중 타깃 빌드도 경로에 프레임워크가 없어도 충돌을 일으킬 수 있습니다.

상세 정보

작성자의 원본 설명

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

인기도

GitHub 스타
5.8k
순위
#14595
라이선스
MIT
업데이트
2026. 11. 2.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬