{"record":{"id":"6b307a9bbcc206cb","repo":"dotnet/runtime","slug":"option-s-missing-property","errorCode":null,"errorMessage":"Option %s: missing property\n","messagePattern":"Option (.+?): missing property\n","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/coreclr/hosts/corerun/corerun.cpp","lineNumber":796,"sourceCode":"        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;\n            }\n\n            string_t key = prop.substr(0, delim_maybe);\n            string_t value = prop.substr(delim_maybe + 1);\n            config.user_defined_keys.push_back(std::move(key));\n            config.user_defined_values.push_back(std::move(value));\n        }\n        else if (pal::strcmp(option, W(\"l\")) == 0 || (pal::strcmp(option, W(\"preload\")) == 0))\n        {","sourceCodeStart":778,"sourceCodeEnd":814,"githubUrl":"https://github.com/dotnet/runtime/blob/60108ba66eb7d1d12f595480091b4ad80a24b172/src/coreclr/hosts/corerun/corerun.cpp#L778-L814","documentation":"Printed at src/coreclr/hosts/corerun/corerun.cpp:796 when -p/--property is the last token (i>=argc) so no key=value string follows. The option requires a property argument.","triggerScenarios":"Triggered by `corerun -p` or `corerun --property` as the final argument, with no property token after it.","commonSituations":"A loop generating properties stops early, an env-var expansion yields nothing, or the user simply forgot the value when constructing the command.","solutions":["Append a key=value pair after -p, e.g. `-p System.GC.Server=true`.","Validate that scripts producing -p arguments always emit a value.","Use the long form `--property KEY=VALUE` for clarity in scripts."],"exampleFix":"// before\ncorerun -p MyApp.dll\n// after\ncorerun -p System.GC.Server=true MyApp.dll","handlingStrategy":"validation","validationCode":"// Ensure -p/--property is followed by a token\nbool property_ok(int argc, char** argv) {\n    for (int i=1;i<argc;i++) {\n        if (!strcmp(argv[i],\"-p\") || !strcmp(argv[i],\"--property\")) {\n            if (i+1>=argc) return false;\n        }\n    }\n    return true;\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always emit a KEY=VALUE after -p.","In scripts, assert the property list is non-empty before invoking corerun.","Use the long --property form for readability."],"tags":["coreclr","corerun","cli","argument-parsing","properties"],"backgroundTag":null,"analyzedSha":"60108ba66eb7d1d12f595480091b4ad80a24b172","analyzedAt":"2026-08-10T18:54:11.478Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}