{"record":{"id":"ab9b06bdfbfc75b4","repo":"dotnet/runtime","slug":"s","errorCode":null,"errorMessage":"%s\n","messagePattern":"%s\n","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/coreclr/hosts/corerun/corerun.cpp","lineNumber":253,"sourceCode":"        }\n\n        std::fprintf(fd, \"Managed assembly: %s\\n\", _managedAssembly);\n        std::fprintf(fd, \"Arguments (%d): \", _argc);\n        for (int i = 0; i < _argc; ++i)\n        {\n            std::fprintf(fd, \"%s \", _argv[i]);\n        }\n        std::fprintf(fd, \"\\n\");\n    }\n};\n\n// The current CoreCLR instance details.\nstatic void* CurrentClrInstance;\nstatic unsigned int CurrentAppDomainId;\n\nstatic void log_error_info(const char* line)\n{\n    std::fprintf(stderr, \"%s\\n\", line);\n}\n\nsize_t HOST_CONTRACT_CALLTYPE get_runtime_property(\n    const char* key,\n    char* value_buffer,\n    size_t value_buffer_size,\n    void* contract_context)\n{\n    configuration* config = static_cast<configuration *>(contract_context);\n\n    if (::strcmp(key, HOST_PROPERTY_ENTRY_ASSEMBLY_NAME) == 0)\n    {\n        // Compute the entry assembly name based on the entry assembly full path\n        pal::string_t dir;\n        pal::string_t file;\n        pal::split_path_to_dir_filename(config->entry_assembly_fullpath, dir, file);\n        file = file.substr(0, file.rfind(W('.')));\n","sourceCodeStart":235,"sourceCodeEnd":271,"githubUrl":"https://github.com/dotnet/runtime/blob/60108ba66eb7d1d12f595480091b4ad80a24b172/src/coreclr/hosts/corerun/corerun.cpp#L235-L271","documentation":"log_error_info() at src/coreclr/hosts/corerun/corerun.cpp:253 is the error-writer callback registered with CoreCLR via coreclr_set_error_writer (line 596). CoreCLR invokes it with diagnostic strings (assembly-load failures, binding errors, runtime errors) and corerun writes them verbatim to stderr. Any CoreCLR-reported error surfaces through this line.","triggerScenarios":"CoreCLR emits an error during initialize/execute/shutdown — e.g. a missing dependency assembly, TPA list misconfiguration, trust/casablanca failure, or a surfaced unhandled managed exception.","commonSituations":"Missing System.Private.CoreLib.dll or other TPA assemblies; wrong TRUSTED_PLATFORM_ASSEMBLIES property; APP_PATHS pointing at nonexistent assemblies; framework version mismatch.","solutions":["Read the full error line printed — it names the specific CoreCLR failure.","Verify the TPA list and APP_PATHS properties point at existing assemblies.","Ensure System.Private.CoreLib.dll and the BCL assemblies are present in the coreclr directory.","Rebuild/restore the target framework so all dependencies exist."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"for (auto& p : required_assembly_paths) {\n    if (!pal::file_exists(p.c_str())) {\n        pal::fprintf(stderr, W(\"Missing required assembly: %s\\n\"), p.c_str());\n        return EXIT_FAILURE;\n    }\n}","typeGuard":null,"tryCatchPattern":"int hr = coreclr_initialize_func(exePath, ...);\nif (FAILED(hr)) {\n    fprintf(stderr, \"coreclr_initialize failed: hr=0x%08x\\n\", hr);\n    return EXIT_FAILURE;\n}","preventionTips":["Validate all assembly paths exist before calling coreclr_initialize.","Inspect coreclr_initialize/coreclr_execute_assembly return codes, not just the error-writer output."],"tags":["dotnet","coreclr","corerun","native-host","runtime"],"backgroundTag":null,"analyzedSha":"60108ba66eb7d1d12f595480091b4ad80a24b172","analyzedAt":"2026-08-10T18:54:11.478Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}