{"record":{"id":"9b741663b9d5ad9e","repo":"dotnet/runtime","slug":"end-coreclr-initialize-failed-error-0x-08x","errorCode":null,"errorMessage":"END: coreclr_initialize failed - Error: 0x%08x\n","messagePattern":"END: coreclr_initialize failed - Error: 0x%08x\n","errorType":"console","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"src/coreclr/hosts/corerun/corerun.cpp","lineNumber":617,"sourceCode":"#ifdef TARGET_WASM\n    // install the pinvoke override callback to resolve p/invokes to statically linked libraries\n    add_pinvoke_override();\n#endif // TARGET_WASM\n\n    int result;\n    result = coreclr_init_func(\n        exe_path_utf8.c_str(),\n        \"corerun\",\n        propertyCount,\n        propertyKeys.data(),\n        propertyValues.data(),\n        &CurrentClrInstance,\n        &CurrentAppDomainId);\n    if (FAILED(result))\n    {\n        pal::fprintf(stderr, W(\"BEGIN: coreclr_initialize failed - Error: 0x%08x\\n\"), result);\n        logger.dump_details();\n        pal::fprintf(stderr, W(\"END: coreclr_initialize failed - Error: 0x%08x\\n\"), result);\n        return -1;\n    }\n\n    if (coreclr_set_error_writer_func != nullptr)\n    {\n        coreclr_set_error_writer_func(nullptr);\n    }\n\n    int exit_code;\n    {\n        actions.before_execute_assembly(config.entry_assembly_fullpath);\n\n        result = coreclr_execute_func(\n            CurrentClrInstance,\n            CurrentAppDomainId,\n            config.entry_assembly_argc,\n            argv_utf8.get(),\n            entry_assembly_utf8.c_str(),","sourceCodeStart":599,"sourceCodeEnd":635,"githubUrl":"https://github.com/dotnet/runtime/blob/290d5ab72cc1102813fbc0406fb186ceadabc340/src/coreclr/hosts/corerun/corerun.cpp#L599-L635","documentation":"Closing marker (matching the BEGIN at line 615) that terminates the diagnostic block printed after coreclr_initialize() fails. The same HRESULT is repeated so log parsers can bracket the dump_details() output (exe path, properties, managed assembly, arguments) between BEGIN and END lines.","triggerScenarios":"Always emitted immediately after logger.dump_details() following a FAILED coreclr_init_func() result at line 613-614. Never appears without the preceding BEGIN line.","commonSituations":"Same as error 201; this line exists purely for log bracketing and tooling that extracts the property dump between BEGIN/END.","solutions":["Treat BEGIN (201) and END (202) as a pair; capture everything between them as the failure context.","Apply the same HRESULT-driven diagnosis as for error 201.","Automate extraction with a log filter that grabs lines between 'BEGIN: coreclr_initialize failed' and 'END: coreclr_initialize failed'."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"# log scraper: extract everything between BEGIN and END for 201\ngrep -A60 'BEGIN: coreclr_initialize failed' run.log | sed '/END: coreclr_initialize failed/q'","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Parse logs as BEGIN..END blocks rather than individual lines.","Use the same extraction logic as for errors 203/204.","Keep dumps in CI artifacts for every failed corerun invocation."],"tags":["coreclr","corerun","runtime-host","logging","hresult"],"analyzedSha":"290d5ab72cc1102813fbc0406fb186ceadabc340","analyzedAt":"2026-08-06T19:57:01.276Z","schemaVersion":2},"datasetVersion":"2026-08-06T23:17:07.152Z"}