{"record":{"id":"32e92bb822cbcf0f","repo":"dotnet/runtime","slug":"export-s-not-found","errorCode":null,"errorMessage":"Export '%s' not found.\n","messagePattern":"Export '(.+?)' not found\\.\n","errorType":"console","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"src/coreclr/hosts/corerun/corerun.cpp","lineNumber":200,"sourceCode":"    if (*fptr != nullptr)\n        return true;\n#else // !TARGET_WASM\n    if (!strcmp(symbol, \"coreclr_initialize\")){\n        *fptr = (void*)coreclr_initialize;\n        return true;\n    } else if (!strcmp(symbol, \"coreclr_execute_assembly\")){\n        *fptr = (void*)coreclr_execute_assembly;\n        return true;\n    } else if (!strcmp(symbol, \"coreclr_shutdown_2\")){\n        *fptr = (void*)coreclr_shutdown_2;\n        return true;\n    } else if (!strcmp(symbol, \"coreclr_set_error_writer\")){\n        *fptr = (void*)coreclr_set_error_writer;\n        return true;\n    }\n#endif // !TARGET_WASM\n\n    pal::fprintf(stderr, W(\"Export '%s' not found.\\n\"), symbol);\n    return false;\n}\n\nclass logger_t final\n{\n    const char* _exePath;\n    int _propertyCount;\n    const char** _propertyKeys;\n    const char** _propertyValues;\n    const char* _managedAssembly;\n    int _argc;\n    const char** _argv;\npublic:\n    logger_t(\n        const char* exePath,\n        int propertyCount, const char** propertyKeys, const char** propertyValues,\n        const char* managedAssembly, int argc, const char** argv)\n    : _exePath{ exePath }","sourceCodeStart":182,"sourceCodeEnd":218,"githubUrl":"https://github.com/dotnet/runtime/blob/290d5ab72cc1102813fbc0406fb186ceadabc340/src/coreclr/hosts/corerun/corerun.cpp#L182-L218","documentation":"Printed by try_get_export() when pal::get_module_symbol() returns NULL for a required CoreCLR export symbol (e.g. 'coreclr_initialize', 'coreclr_execute_assembly', 'coreclr_shutdown_2'). It means the loaded coreclr dynamic library does not expose the symbol the host expects. This is almost always a version skew between the corerun host binary and the coreclr library it loaded.","triggerScenarios":"corerun successfully calls pal::try_load_coreclr() (so a coreclr .dll/.so/.dylib was found and dlopen/LoadLibrary succeeded), but the subsequent pal::get_module_symbol(mod, \"coreclr_initialize\") (or execute/shutdown) returns nullptr. On TARGET_WASM it fires for any symbol other than the four hardcoded ones.","commonSituations":"Pointing --clr-path (or CORE_ROOT) at a coreclr library from a different .NET build/architecture; a stripped or partial coreclr build that did not export the host API; a corrupted install; running a 32-bit corerun against a 64-bit coreclr or vice versa.","solutions":["Verify CORE_ROOT / --clr-path points to a complete, matching-architecture CoreCLR build that contains coreclr.dll/libcoreclr.so/libcoreclr.dylib.","Reinstall or rebuild the .NET runtime so corerun and coreclr come from the same commit/build.","Inspect the loaded library's exports (dumpbin /exports, nm -D, objdump -T) to confirm 'coreclr_initialize', 'coreclr_execute_assembly', and 'coreclr_shutdown_2' are present.","On WASM, ensure only the four supported exports are requested and that the pinvoke-override path is taken for statically linked libraries."],"exampleFix":"# before: CORE_ROOT points at a mismatched/incomplete build\nexport CORE_ROOT=/opt/dotnet/old/lib\ncorerun App.dll\n# after: point at the matching runtime that ships corerun\ncorerun -c /path/to/matching/coreclr/lib App.dll","handlingStrategy":"validation","validationCode":"# before invoking corerun, confirm the coreclr lib exports the required symbols\nLIB=\"$CORE_ROOT/libcoreclr.so\"   # coreclr.dll on Windows, libcoreclr.dylib on macOS\nif command -v nm >/dev/null; then\n  for sym in coreclr_initialize coreclr_execute_assembly coreclr_shutdown_2; do\n    nm -D \"$LIB\" | grep -q \" $sym\" || echo \"MISSING: $sym in $LIB\"\n  done\nfi","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always source corerun and coreclr from the same build/install.","Pin CORE_ROOT to a runtime version directory that matches the corerun binary.","Verify architecture (x64/arm64/x86) matches between corerun and coreclr.","Add a CI step that runs 'nm -D / dumpbin /exports' to assert the three required exports exist."],"tags":["coreclr","corerun","runtime-host","symbol-resolution","version-skew"],"analyzedSha":"290d5ab72cc1102813fbc0406fb186ceadabc340","analyzedAt":"2026-08-06T19:57:01.276Z","schemaVersion":2},"datasetVersion":"2026-08-06T23:17:07.152Z"}