clr-activation-debugging
Fungsinya
Skill ini mencari tahu mengapa aplikasi .NET Framework yang lebih lama memuat runtime yang salah atau gagal memuat runtime. Skill ini untuk pengembang dan administrator yang memecahkan masalah aplikasi .NET Framework lama di Windows.
Kapan dipakai
- βSaat proses .NET Framework gagal dengan error tentang pencarian runtime yang akan dipakai.
- βSaat runtime .NET Framework yang salah dijalankan untuk sebuah aplikasi.
- βSaat dialog instalasi fitur .NET 3.5 muncul tanpa diduga atau tidak muncul sama sekali.
Link skill
https://github.com/dotnet/skills/blob/main/plugins/dotnet-diag/skills/clr-activation-debugging/SKILL.mdSalin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.
Cara pakai
Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.
Pesan siap tempel
Untuk Claude Code, Codex, atau Cursor: jalankan di folder proyek, lalu skill langsung terpasang.
Unduh SKILL.md lalu taruh di folder skill agen Anda.
Contoh permintaan ke AI
βAplikasi .NET Framework saya memulai runtime 2.0, bukan 4.0. Baca log aktivasi dan jelaskan alasannya.β
5 skill baru setiap minggu. 1 menit baca.
Cara kerjanya
Agent membaca log pemuatan runtime yang dihasilkan shim, mengikuti setiap keputusan yang diambil shim, lalu menjelaskan runtime mana yang dipilih dan alasannya.
Konten teknis (SKILL.md asli)
Teks asli dari pembuat, dalam bahasa Inggris, langsung dari 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
InprocServer32for 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
Pertanyaan umum
Apakah skill ini mencakup .NET modern?
Tidak. Skill ini hanya mencakup .NET Framework, bukan CoreCLR atau .NET 5 ke atas.
Apakah skill ini menangani error pemuatan assembly?
Tidak. Error itu membutuhkan alat log yang berbeda, seperti Fusion log viewer.
Apa itu shim?
Shim adalah DLL sistem yang memutuskan runtime .NET Framework mana yang akan dimuat untuk sebuah proses.
Detail
Deskripsi asli dari pembuat
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
Popularitas
- Bintang GitHub
- 5.8k
- Peringkat
- #14576
- Lisensi
- MIT
- Diperbarui
- 2/11/2026
Komentar
- β¦
Skill lain dari repositori ini
create-custom-agent
5.8kMembantu agent Anda membuat file agen kustom VS Code dengan alatnya sendiri, instruksi, dan serah terima ke agent lain.
create-skill
5.8kMembantu agent Anda membuat skill agent baru dengan nama yang valid, deskripsi pemicu yang jelas, dan file SKILL.md yang mengikuti standar.
csharp-scripts
5.8kMembantu agent Anda menjalankan program C# kecil sebagai satu file dengan alat baris perintah .NET, tanpa membuat proyek lengkap.
dotnet-pinvoke
5.8kMembantu agent Anda memanggil pustaka native C atau C++ dari .NET dengan benar, mencakup tanda tangan, penanganan string, memori, dan safe handle.
Skill serupa
api-connector-builder
280kMembuat agent Anda membangun koneksi API baru mengikuti pola yang sudah ada. Gunakan saat ingin menambah integrasi lagi tanpa membuat cara baru.
api-design
280kMembantu agent Anda merancang REST API sesuai praktik terbaik. Berguna untuk mengatur cara API berkomunikasi, menampilkan error, dan mengorganisasi data.
backend-patterns
280kMembantu agent Anda dengan pola arsitektur sisi server dan optimasi database. Berguna untuk membangun atau meninjau kode yang berjalan di server.