{"record":{"id":"92b1e837f185c5e8","repo":"dotnet/runtime","slug":"unknown-option-s","errorCode":null,"errorMessage":"Unknown option %s\n","messagePattern":"Unknown option (.+?)\n","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/coreclr/hosts/corerun/corerun.cpp","lineNumber":857,"sourceCode":"        {\n            i++;\n            if (i >= argc)\n            {\n                pal::fprintf(stderr, W(\"Option %s: missing .env file path\\n\"), arg);\n                break;\n            }\n\n            std::ifstream dotenvFile{ pal::convert_to_utf8(argv[i]) };\n            config.dotenv_configuration = dotenv{ pal::string_t{ argv[i] }, dotenvFile};\n        }\n        else if ((pal::strcmp(option, W(\"?\")) == 0 || (pal::strcmp(option, W(\"h\")) == 0 || (pal::strcmp(option, W(\"help\")) == 0))))\n        {\n            display_usage();\n            break;\n        }\n        else\n        {\n            pal::fprintf(stderr, W(\"Unknown option %s\\n\"), arg);\n            break;\n        }\n    }\n\n    return false;\n}\n\n// Forward declaration for self testing method.\nstatic int self_test();\n\n//\n// Entry points\n//\n\nint MAIN(const int argc, const char_t* argv[])\n{\n    configuration config{};\n    if (!parse_args(argc, argv, config))","sourceCodeStart":839,"sourceCodeEnd":875,"githubUrl":"https://github.com/dotnet/runtime/blob/60108ba66eb7d1d12f595480091b4ad80a24b172/src/coreclr/hosts/corerun/corerun.cpp#L839-L875","documentation":"Printed at src/coreclr/hosts/corerun/corerun.cpp:857 when an option token does not match any known option (c, p, l, d, st, e, ?, h, help) after stripping leading dashes. It is the fallback else-branch of the option switch.","triggerScenarios":"Triggered when a token starting with '-' or '--' is not one of the recognized options. E.g. `corerun --verbose MyApp.dll` or `corerun -X`.","commonSituations":"Misspelled option, using flags that belong to a different host (dotnet run vs corerun), or passing an option supported only in newer corerun builds.","solutions":["Run `corerun --help` to list supported options.","Remove the unsupported flag or replace it with the equivalent supported option.","Upgrade corerun if the flag is documented for a newer version."],"exampleFix":"// before\ncorerun --verbose HelloWorld.dll\n// after\ncorerun -d HelloWorld.dll","handlingStrategy":"validation","validationCode":"// Validate against the known option set\n#include <set>\n#include <string>\nbool options_known(int argc, char** argv) {\n    static const std::set<std::string> known = {\"-c\",\"--clr-path\",\"-p\",\"--property\",\"-l\",\"--preload\",\"-d\",\"--debug\",\"-st\",\"-e\",\"--env\",\"-?\",\"-h\",\"--help\"};\n    for (int i=1;i<argc;i++) {\n        if (argv[i][0]=='-' && known.find(argv[i])==known.end()) return false;\n    }\n    return true;\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run `corerun --help` to enumerate options.","Remove flags belonging to other hosts (dotnet run).","Upgrade corerun if a documented flag is rejected."],"tags":["coreclr","corerun","cli","argument-parsing"],"backgroundTag":null,"analyzedSha":"60108ba66eb7d1d12f595480091b4ad80a24b172","analyzedAt":"2026-08-10T18:54:11.478Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}