{"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/60108ba66eb7d1d12f595480091b4ad80a24b172/src/coreclr/hosts/corerun/corerun.cpp#L599-L635","documentation":"The closing marker of the coreclr_initialize failure block at src/coreclr/hosts/corerun/corerun.cpp:617. It prints after logger.dump_details() to delimit the end of the diagnostic dump. The same HRESULT as 240 is printed so log parsers can correlate the begin/end pair. The function then returns -1.","triggerScenarios":"Always emitted together with error 240 whenever coreclr_init_func fails. The trigger is identical to error 240; this line exists only to frame the diagnostic output.","commonSituations":"Seen in every corerun launch where the runtime refuses to start. CI logs show this line directly after the detailed stack/property dump that the BEGIN line introduced.","solutions":["Treat 240 and 241 as one event: capture the entire BEGIN..END block and decode the HRESULT.","Apply the same fixes as for error 240 (runtime path, bitness, properties).","If no useful detail appears between BEGIN and END, enable verbose CoreCLR diagnostics via the DOTNET_DiagnosticPorts / DOTNETCORE_DiagnosticPorts environment variables or a checked runtime build."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["Treat the BEGIN/END pair as a single log block; capture everything in between for triage.","Apply the same runtime-path validation as for error 240 before launching corerun."],"tags":["coreclr","corerun","runtime-initialization","host"],"backgroundTag":null,"analyzedSha":"60108ba66eb7d1d12f595480091b4ad80a24b172","analyzedAt":"2026-08-10T18:54:11.478Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}