{"record":{"id":"7ae76a8a52032ca3","repo":"dotnet/runtime","slug":"option-s-missing-path","errorCode":null,"errorMessage":"Option %s: missing path\n","messagePattern":"Option (.+?): missing path\n","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/coreclr/hosts/corerun/corerun.cpp","lineNumber":787,"sourceCode":"            pal::fprintf(stderr, W(\"Option %s: invalid form\\n\"), arg);\n            break; // Invalid option\n        }\n\n        const char_t* option = arg + 1;\n        if (option[0] == W('-')) // Handle double '--'\n            option++;\n\n        // Path to core_root\n        if (pal::strcmp(option, W(\"c\")) == 0 || (pal::strcmp(option, W(\"clr-path\")) == 0))\n        {\n            i++;\n            if (i < argc)\n            {\n                config.clr_path = argv[i];\n            }\n            else\n            {\n                pal::fprintf(stderr, W(\"Option %s: missing path\\n\"), arg);\n                break;\n            }\n        }\n        else if (pal::strcmp(option, W(\"p\")) == 0 || (pal::strcmp(option, W(\"property\")) == 0))\n        {\n            i++;\n            if (i >= argc)\n            {\n                pal::fprintf(stderr, W(\"Option %s: missing property\\n\"), arg);\n                break;\n            }\n\n            string_t prop = argv[i];\n            size_t delim_maybe = prop.find(W('='));\n            if (delim_maybe == string_t::npos)\n            {\n                pal::fprintf(stderr, W(\"Option %s: '%s' missing property value\\n\"), arg, prop.c_str());\n                break;","sourceCodeStart":769,"sourceCodeEnd":805,"githubUrl":"https://github.com/dotnet/runtime/blob/b7130aa5e416e88ac48fafe92bf56a9d64e13c97/src/coreclr/hosts/corerun/corerun.cpp#L769-L805","documentation":"Missing-path error for the -c/--clr-path option (corerun.cpp:787). The parser consumes the next argument as the CoreCLR path; if -c is the last token (i >= argc), it prints 'Option %s: missing path' and breaks, making MAIN return EXIT_FAILURE.","triggerScenarios":"Supplying `-c` or `--clr-path` as the final argument with no following value, e.g. `corerun -c` or `corerun app.dll --clr-path`. The guard is at corerun.cpp:785-786.","commonSituations":"Truncated command line, a missing environment-variable expansion for the path value, or a copy-paste that dropped the path token.","solutions":["Provide a path token immediately after -c/--clr-path pointing at a valid CoreCLR directory.","If the path comes from a variable, ensure the variable is set and non-empty before invoking corerun.","Run `corerun -?` to confirm the option syntax."],"exampleFix":"// before\ncorerun -c app.dll\n// after\ncorerun -c /opt/dotnet/shared/Microsoft.NETCore.App/8.0.11 app.dll","handlingStrategy":"validation","validationCode":"# Ensure --clr-path always has a value\n: \"${CLR_PATH:?--clr-path value required}\"\ncorerun -c \"$CLR_PATH\" app.dll","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always pair -c/--clr-path with a path token.","Guard variables that expand into the path with a non-empty check.","Validate the path directory exists before launching."],"tags":["corerun","cli","args","clr-path"],"analyzedSha":"b7130aa5e416e88ac48fafe92bf56a9d64e13c97","analyzedAt":"2026-08-07T06:17:13.108Z","schemaVersion":2},"datasetVersion":"2026-08-07T15:17:06.553Z"}