{"record":{"id":"d973d62c470b54f0","repo":"dotnet/runtime","slug":"end-coreclr-execute-assembly-failed-error-0x-0","errorCode":null,"errorMessage":"END: coreclr_execute_assembly failed - Error: 0x%08x\n","messagePattern":"END: coreclr_execute_assembly failed - Error: 0x%08x\n","errorType":"console","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"src/coreclr/hosts/corerun/corerun.cpp","lineNumber":641,"sourceCode":"        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(),\n            (uint32_t*)&exit_code);\n        if (FAILED(result))\n        {\n            pal::fprintf(stderr, W(\"BEGIN: coreclr_execute_assembly failed - Error: 0x%08x\\n\"), result);\n            logger.dump_details();\n            pal::fprintf(stderr, W(\"END: coreclr_execute_assembly failed - Error: 0x%08x\\n\"), result);\n            return -1;\n        }\n\n        actions.after_execute_assembly();\n    }\n\n#ifdef TARGET_BROWSER\n    // in NodeJS/Browser this is not really end of the process, JS keeps running.\n    // We want to keep the CoreCLR runtime alive to be able to process async work\n    // The NodeJS process is kept alive by pending async work via safeSetTimeout() -> runtimeKeepalivePush()\n    // The actual exit code would be set by SystemJS_ResolveMainPromise if the managed Main() is async.\n    // Or in Module.onExit handler when  managed Main() is synchronous.\n    return exit_code;\n#else // TARGET_BROWSER\n    int final_exit_code = corerun_shutdown(exit_code);\n#ifdef TARGET_WASI\n    // wasi:cli/exit's stable exit() only signals ok/err, so wasmtime\n    // collapses any non-zero Main return to host exit 1. When","sourceCodeStart":623,"sourceCodeEnd":659,"githubUrl":"https://github.com/dotnet/runtime/blob/60108ba66eb7d1d12f595480091b4ad80a24b172/src/coreclr/hosts/corerun/corerun.cpp#L623-L659","documentation":"Closing marker at src/coreclr/hosts/corerun/corerun.cpp:641 for the coreclr_execute_assembly failure block. Brackets the logger.dump_details() output for the execute failure; the function then returns -1. Same HRESULT as 242.","triggerScenarios":"Always emitted alongside error 242. It exists to delimit the diagnostic dump; the trigger is the same failed coreclr_execute_func call.","commonSituations":"Appears in logs immediately after 242 with the diagnostic detail in between. Used by log scrapers to find the start and end of the failure block.","solutions":["Capture and analyze the full BEGIN..END block together with error 242.","Apply the same assembly/runtime fixes described for error 242.","If the dump between markers is empty, run a checked/debug runtime build for richer detail."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["Capture the full BEGIN..END dump for analysis.","Pre-validate the assembly as described for error 242.","Use a checked runtime build for richer diagnostics if the dump is empty."],"tags":["coreclr","corerun","assembly-execution","host"],"backgroundTag":null,"analyzedSha":"60108ba66eb7d1d12f595480091b4ad80a24b172","analyzedAt":"2026-08-10T18:54:11.478Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}