본문으로 건너뛰기
Skillpedia
API 및 서버 (백엔드)5.8k · #14576

clr-activation-debugging

하는 일

이 스킬은 오래된 .NET Framework 앱이 잘못된 런타임을 불러오거나 런타임을 불러오지 못하는 이유를 알아냅니다. Windows에서 레거시 .NET Framework 앱을 문제 해결하는 개발자와 관리자를 위한 스킬입니다.

사용하는 경우

  • ✓.NET Framework 프로세스가 사용할 런타임을 찾지 못한다는 오류로 실패할 때.
  • ✓앱에 대해 잘못된 .NET Framework 버전이 시작될 때.
  • ✓예상하지 못한 .NET 3.5 기능 설치 대화 상자가 나타나거나 나타나지 않을 때.

스킬 링크

https://github.com/dotnet/skills/blob/main/plugins/dotnet-diag/skills/clr-activation-debugging/SKILL.md

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

사용 방법

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

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

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

AI에게 요청하는 예시

“제 .NET Framework 앱이 4.0 대신 2.0 런타임을 시작합니다. 활성화 로그를 읽고 이유를 알려 주세요.”

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

작동 방식

에이전트가 shim이 만든 런타임 로딩 로그를 읽고, shim이 내린 각 결정을 따라가며, 어떤 런타임이 왜 선택되었는지 설명합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

CLR Activation Debugging

Diagnose .NET Framework runtime activation issues by analyzing CLR activation logs (CLRLoad logs) produced by the shim (mscoree.dll). These logs record every decision the shim makes when selecting and loading a CLR version.

When to Use

  • A process fails to load the CLR at all ("Unable to find a version of the runtime to use")
  • The shim picks the wrong CLR version (e.g., v2.0 instead of v4.0)
  • Unexpected .NET 3.5 Feature-on-Demand (FOD) install dialogs appear
  • FOD dialogs are expected but do NOT appear
  • Both CLR v2 and CLR v4 load into the same process, causing failures
  • A COM object fails to activate because the shim can't resolve the runtime
  • Legacy hosting APIs (CorBindToRuntime) bind to an unexpected version

When Not to Use

  • Modern .NET (CoreCLR / .NET 5+) — this skill covers .NET Framework only (the mscoree.dll shim)
  • Assembly binding failures — use Fusion logs (fuslogvw.exe), not CLR activation logs
  • Runtime crashes after the CLR has loaded — activation succeeded; the problem is elsewhere

Background

The Shim Architecture

The .NET Framework shim has two layers:

  • mscoree.dll (the "shell shim") — the public-facing DLL that is the registered InprocServer32 for CLR-hosted COM objects and the entry point for _CorExeMain, legacy APIs, etc.
  • mscoreei.dll — the actual shim implementation where the runtime selection logic, logging, and activation decisions live. mscoree.dll forwards into mscoreei.dll.

When reading logs, the caller-name:mscoreei.dll in FOD command lines reflects this — it's mscoreei.dll doing the work.

.NET 3.5 / v2.0.50727 Version Mapping

.NET 2.0, 3.0, and 3.5 all share the same CLR runtime version: v2.0.50727. The "3.0" and "3.5" releases were library additions on top of CLR v2.0. For activation purposes, they are all "v2.0.50727." When the shim resolves to v2.0.50727 or FOD offers to install "NetFx3", it's installing the CLR v2.0 runtime (plus the 3.0/3.5 libraries). Similarly, CLR v4.0 (v4.0.30319) covers all .NET Framework versions from 4.0 through 4.8.x.

.NET 3.5 Availability on Recent Windows

On recent Windows versions (Windows 11 Insider Preview Build 27965 and future platform releases), .NET Framework 3.5 is no longer available as a Windows optional component (Feature-on-Demand). It must be installed from a standalone MSI. This means the FOD dialog (fondue.exe /enable-feature:NetFx3) will not succeed on these systems even if it fires. On Windows 10 and Windows 11 through 25H2, FOD remains available. .NET Framework 3.5 reaches end of support on January 9, 2029.

Shim HRESULT Codes

When the shim fails, it returns specific HRESULTs in the 0x8013xxxx range. These are the errors you'll see from callers (not in the activation logs themselves, which log human-readable messages):

HRESULT Symbol Meaning
0x80131700 CLR_E_SHIM_RUNTIMELOAD Cannot find or load a suitable runtime version. This is the most common shim error — it's what callers see when capped legacy activation fails on a v4-only machine.
0x80131701 CLR_E_SHIM_RUNTIMEEXPORT Found a runtime but failed to get a required export or interface from it.
0x80131702 CLR_E_SHIM_INSTALLROOT The .NET Framework install root is missing or invalid in the registry.
0x80131703 CLR_E_SHIM_INSTALLCOMP A required component of the installation is missing.
0x80131704 CLR_E_SHIM_LEGACYRUNTIMEALREADYBOUND A different runtime is already bound as the legacy runtime. A legacy API tried to bind to a version that conflicts with the one already chosen.
0x80131705 CLR_E_SHIM_SHUTDOWNINPROGRESS The shim is shutting down and cannot service the request.

If a user reports one of these HRESULTs (especially 0x80131700), CLR activation logs are the right diagnostic tool.

Prerequisites

CLR activation logging must be enabled to produce log files. If the user doesn't have logs yet, instruct them to enable logging:

Via environment variable (recommended — scoped to current session):

set COMPLUS_CLRLoadLogDir=C:\CLRLoadLogs

Via registry (machine-wide — affects all .NET Framework processes):

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework
  CLRLoadLogDir = "C:\CLRLoadLogs" (REG_SZ)

On 64-bit systems, also set under Wow6432Node if 32-bit processes are involved.

⚠️ The log directory must already exist. The shim will n

자주 묻는 질문

최신 .NET도 다루나요?

아니요. .NET Framework만 다루며, CoreCLR이나 .NET 5 이상은 다루지 않습니다.

어셈블리 로딩 오류도 다루나요?

아니요. 그런 오류는 Fusion 로그 뷰어 같은 다른 로그 도구가 필요합니다.

shim이란 무엇인가요?

프로세스마다 어떤 .NET Framework 런타임을 불러올지 결정하는 시스템 DLL입니다.

상세 정보

작성자의 원본 설명

Diagnoses .NET Framework CLR activation issues using CLR activation logs (CLRLoad logs) produced by mscoree.dll. Use when: the shim picks the wrong runtime, fails to load any runtime, shows unexpected .NET 3.5 Feature-on-Demand (FOD) dialogs, unexpectedly does NOT show FOD dialogs, loads both v2 and v4 into the same process causing failures, or any time someone is wondering "what is happening with .NET Framework activation?"

repo: dotnet/skills

인기도

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

이 스킬이 유용한가요?

0

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

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬