Loading...
Loading...
Compare original and translation side by side
InprocServer32_CorExeMaincaller-name:mscoreei.dllInprocServer32_CorExeMaincaller-name:mscoreei.dllfondue.exe /enable-feature:NetFx3fondue.exe /enable-feature:NetFx30x8013xxxx| HRESULT | Symbol | Meaning |
|---|---|---|
| | 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. |
| | Found a runtime but failed to get a required export or interface from it. |
| | The .NET Framework install root is missing or invalid in the registry. |
| | A required component of the installation is missing. |
| | 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. |
| | The shim is shutting down and cannot service the request. |
0x801317000x8013xxxx| HRESULT | 符号 | 含义 |
|---|---|---|
| | 找不到或无法加载合适的运行时版本。这是最常见的垫片错误 —— 在仅安装了v4的机器上,旧版激活被限制时调用方就会收到这个错误。 |
| | 找到了运行时,但无法从中获取所需的导出函数或接口。 |
| | 注册表中.NET Framework的安装根目录缺失或无效。 |
| | 缺少安装所需的组件。 |
| | 已有另一个运行时被绑定为旧版运行时,旧版API尝试绑定的版本与已选择的版本冲突。 |
| | 垫片正在关闭,无法处理请求。 |
0x80131700set COMPLUS_CLRLoadLogDir=C:\CLRLoadLogsHKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework
CLRLoadLogDir = "C:\CLRLoadLogs" (REG_SZ)Wow6432Node⚠️ The log directory must already exist. The shim will not create it. If it doesn't exist, no logs will be written and there will be no error or indication of failure.
{ProcessName}.CLRLoad{NN}.logset COMPLUS_CLRLoadLogDir=C:\\CLRLoadLogsHKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\.NETFramework
CLRLoadLogDir = "C:\\CLRLoadLogs" (REG_SZ)Wow6432Node⚠️ 日志目录必须已提前创建,垫片不会自动创建目录。如果目录不存在,不会生成任何日志,也不会有错误提示或失败通知。
{ProcessName}.CLRLoad{NN}.log| Input | Required | Description |
|---|---|---|
| CLR activation log files | Yes | One or more |
| Symptom description | Recommended | What the user observed (FOD dialog, wrong runtime, failure, etc.) |
| Expected behavior | Recommended | What the user expected to happen |
| 输入项 | 是否必填 | 描述 |
|---|---|---|
| CLR激活日志文件 | 是 | 一个或多个 |
| 症状描述 | 推荐 | 用户观察到的现象(FOD对话框、运行时错误、故障等) |
| 预期行为 | 推荐 | 用户期望的运行结果 |
references/log-format.mdreferences/activation-flow.mdreferences/com-activation.mdreferences/log-format.mdreferences/activation-flow.mdreferences/com-activation.mdDecided on runtime: vX.Y.ZERROR:Launching feature-on-demandCould have launched feature-on-demandV2.0 Capping is preventing considerationgrep -l "ERROR:\|Launching feature-on-demand\|Could have launched" *.log
grep -c "Launching feature-on-demand" *.log| Process | Log Files | Outcome | Runtime Selected | FOD? |
|---|---|---|---|---|
| ... | ... | ... | ... | ... |
Decided on runtime: vX.Y.ZERROR:Launching feature-on-demandCould have launched feature-on-demandV2.0 Capping is preventing considerationgrep -l "ERROR:\\|Launching feature-on-demand\\|Could have launched" *.log
grep -c "Launching feature-on-demand" *.log| 进程 | 日志文件 | 结果 | 选中的运行时 | 是否触发FOD? |
|---|---|---|---|---|
| ... | ... | ... | ... | ... |
⚠️ Nested log entries: The shim's own internal calls can trigger additional log entries within an activation sequence that is already being logged. For example, acall may internally callDllGetClassObject, which callsComputeVersionString, each generating log lines. When the FOD check runs ("Checking if feature-on-demand installation would help"), it re-runs the entire version computation — producing a secondFindLatestVersionblock within the same activation. Don't mistake these nested/re-entrant entries for separate activation attempts.ComputeVersionString
⚠️ 嵌套日志条目: 垫片自身的内部调用可能会在正在记录的激活序列中触发额外的日志条目。例如,调用可能在内部调用DllGetClassObject,后者又调用ComputeVersionString,每个调用都会生成日志行。当运行FOD检查时(“Checking if feature-on-demand installation would help”),会重新运行完整的版本计算 —— 在同一个激活流程中生成第二个FindLatestVersion块。不要将这些嵌套/重入的条目误认为是独立的激活尝试。ComputeVersionString
FunctionCall:MethodCall:| Entry Point | Meaning |
|---|---|
| Managed EXE launch — the binary IS a .NET assembly |
| COM activation — something CoCreated a COM class routed through mscoree.dll |
| Modern (v4+) hosting API |
| Legacy (v1/v2) hosting API — binds the process to one runtime |
| Policy-based hosting API (often called internally after other entry points) |
| Legacy API to load a framework DLL by name |
FunctionCall:MethodCall:| 入口点 | 含义 |
|---|---|
| 托管EXE启动 —— 该二进制文件本身就是.NET程序集 |
| COM激活 —— 某个程序通过CoCreate创建了经由mscoree.dll路由的COM类 |
| 现代(v4+)托管API |
| 旧版(v1/v2)托管API —— 将进程绑定到单个运行时 |
| 基于策略的托管API(通常在其他入口点之后被内部调用) |
| 按名称加载框架DLL的旧版API |
IsLegacyBindCorBindToRuntimeExDllGetClassObjectLoadLibraryShimIsCappedCorBindToRuntimeEx("v4.0.30319", ...)useLegacyV2RuntimeActivationPolicySkuCheckFlagsShouldEmulateExeLaunchLegacyBindRequiredIsLegacyBindCorBindToRuntimeExDllGetClassObjectLoadLibraryShimIsCappedCorBindToRuntimeEx("v4.0.30319", ...)useLegacyV2RuntimeActivationPolicySkuCheckFlagsShouldEmulateExeLaunchLegacyBindRequiredParsing config file: {path}.configConfig File (Open). Result:00000000Config File (Open). Result:80070002Found config file: {path}UseLegacyV2RuntimeActivationPolicy is set to {0|1}<startup useLegacyV2RuntimeActivationPolicy="true"><supportedRuntime><supportedRuntime>Config file includes SupportedRuntime entry. Version: vX.Y.Z, SKU: {sku}<supportedRuntime>Parsing config file: {path}.configConfig File (Open). Result:00000000Config File (Open). Result:80070002Found config file: {path}UseLegacyV2RuntimeActivationPolicy is set to {0|1}<startup useLegacyV2RuntimeActivationPolicy="true"><supportedRuntime><supportedRuntime>Config file includes SupportedRuntime entry. Version: vX.Y.Z, SKU: {sku}<supportedRuntime>Installed Runtime: vX.Y.Z. VERSION_ARCHITECTURE: N{exe} was built with version: vX.Y.ZUsing supportedRuntime: vX.Y.Z<supportedRuntime>FindLatestVersion is returning the following version: vX.Y.Z ... V2.0 Capped: {0|1}Default version of the runtime on the machine: vX.Y.Z(null)(null)Decided on runtime: vX.Y.ZInstalled Runtime: vX.Y.Z. VERSION_ARCHITECTURE: N{exe} was built with version: vX.Y.ZUsing supportedRuntime: vX.Y.Z<supportedRuntime>FindLatestVersion is returning the following version: vX.Y.Z ... V2.0 Capped: {0|1}Default version of the runtime on the machine: vX.Y.Z(null)(null)Decided on runtime: vX.Y.ZERROR: Unable to find a version of the runtime to useSEM_FAILCRITICALERRORS is set to {value}SEM_FAILCRITICALERRORSChecking if feature-on-demand installation would helpLaunching feature-on-demand installation. CmdLine: "...\fondue.exe" /enable-feature:NetFx3Could have launched feature-on-demand installation if was not opted out.SEM_FAILCRITICALERRORSERROR: Unable to find a version of the runtime to useSEM_FAILCRITICALERRORS is set to {value}SEM_FAILCRITICALERRORSChecking if feature-on-demand installation would helpLaunching feature-on-demand installation. CmdLine: "...\\fondue.exe" /enable-feature:NetFx3Could have launched feature-on-demand installation if was not opted out.SEM_FAILCRITICALERRORSFunctionCall:MethodCall:ClrCreateInstanceGetRequestedRuntimeDllGetClassObjectFunctionCall:MethodCall:ClrCreateInstanceGetRequestedRuntimeDllGetClassObjectundefinedundefined
Key values under `InprocServer32`:
- `(Default)` should be `mscoree.dll` for CLR-hosted COM objects
- **Version subkeys** (e.g., `2.0.50727`, `4.0.30319`) indicate which runtime versions registered this CLSID
- **`ImplementedInThisVersion`** under a version subkey means that runtime version natively implements the COM class (not via managed interop)
- **`Assembly`** and **`Class`** under a version subkey indicate a managed COM interop registration
- **`RuntimeVersion`** under a version subkey specifies which CLR version should host this object
**Installed runtimes:**
```powershell
Get-ChildItem 'Registry::HKLM\SOFTWARE\Microsoft\.NETFramework\policy'SEM_FAILCRITICALERRORSSetErrorMode
`InprocServer32`下的关键值:
- `(默认)`对于CLR托管的COM对象应该为`mscoree.dll`
- **版本子键**(例如`2.0.50727`、`4.0.30319`)表示哪个运行时版本注册了这个CLSID
- 版本子键下的**`ImplementedInThisVersion`**表示该运行时版本原生实现了这个COM类(不是通过托管互操作)
- 版本子键下的**`Assembly`**和**`Class`**表示托管COM互操作注册
- 版本子键下的**`RuntimeVersion`**指定应该托管该对象的CLR版本
**已安装的运行时:**
```powershell
Get-ChildItem 'Registry::HKLM\\SOFTWARE\\Microsoft\\.NETFramework\\policy'SEM_FAILCRITICALERRORSSetErrorModeDllGetClassObjectIsCapped: 1(null)SEM_FAILCRITICALERRORS: 0useLegacyV2RuntimeActivationPolicySEM_FAILCRITICALERRORSSEM_FAILCRITICALERRORSSEM_FAILCRITICALERRORSDllGetClassObjectIsCapped: 1(null)SEM_FAILCRITICALERRORS: 0useLegacyV2RuntimeActivationPolicySEM_FAILCRITICALERRORSSEM_FAILCRITICALERRORSSEM_FAILCRITICALERRORSsupportedRuntime<supportedRuntime>supportedRuntime<supportedRuntime>Decided on runtimeDecided on runtimeCorBindToRuntimeExuseLegacyV2RuntimeActivationPolicyCorBindToRuntimeExuseLegacyV2RuntimeActivationPolicy| Pitfall | Correct Approach |
|---|---|
Assuming | Capping only restricts roll-forward enumeration. v4.0 can still be loaded if: a specific version string is passed explicitly, config has |
| Thinking capping is broken or a bug | Capping is intentional — it makes v4 installation non-impactful. On a v4-only machine, legacy codepaths correctly see no runtimes. This is working as designed. |
| Assuming FOD is controlled per-process | |
| Looking only at the first activation in a log | A single log can contain multiple independent activation sequences. The problematic one is often a secondary COM activation, not the initial CLR load. |
| Assuming a missing config file is benign | For native EXEs doing COM activation with legacy/capped bind, the config file (with |
Adding | Without |
Setting | This attribute turns off in-proc SxS — it locks pre-v4 runtimes out of the process. This is usually fine for build tools but should be considered for apps that need to host both v2 and v4. |
| 误区 | 正确做法 |
|---|---|
认为 | 版本限制仅限制前向滚动枚举。以下情况仍可加载v4.0:明确传入特定版本字符串、配置中设置了 |
| 认为版本限制是故障或Bug | 版本限制是故意设计的 —— 它让v4安装不会影响旧系统。在仅安装v4的机器上,旧代码路径看不到任何运行时是符合预期的行为。 |
| 认为FOD是按进程控制的 | |
| 仅查看日志中的第一个激活 | 单个日志可能包含多个独立的激活序列,有问题的通常是后续的COM激活,而非初始的CLR加载。 |
| 认为缺少配置文件没有影响 | 对于执行旧版/受限制绑定COM激活的原生EXE,配置文件(带 |
仅添加 | 没有 |
设置 | 这个属性会关闭进程内SxS —— 禁止v4之前的运行时加载到进程中。这对于构建工具通常没问题,但对于需要同时托管v2和v4的应用需要谨慎考虑。 |
SEM_FAILCRITICALERRORS