dotnet/runtime · error

Option : missing property

Error message

Option %s: missing property

What it means

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.

Solutions

  1. Append a key=value pair after -p, e.g. `-p System.GC.Server=true`.
  2. Validate that scripts producing -p arguments always emit a value.
  3. Use the long form `--property KEY=VALUE` for clarity in scripts.

Example fix

// before
corerun -p MyApp.dll
// after
corerun -p System.GC.Server=true MyApp.dll
Defensive patterns

Strategy: validation

Validate before calling

// Ensure -p/--property is followed by a token
bool property_ok(int argc, char** argv) {
    for (int i=1;i<argc;i++) {
        if (!strcmp(argv[i],"-p") || !strcmp(argv[i],"--property")) {
            if (i+1>=argc) return false;
        }
    }
    return true;
}

Prevention

When it happens

Trigger: Triggered by `corerun -p` or `corerun --property` as the final argument, with no property token after it.

Common situations: A loop generating properties stops early, an env-var expansion yields nothing, or the user simply forgot the value when constructing the command.

Related errors


AI-assisted analysis of dotnet/runtime@60108ba66e (2026-08-10). Data as JSON: /api/errors/6b307a9bbcc206cb. Report an issue: GitHub.

Appendix: source

Thrown at src/coreclr/hosts/corerun/corerun.cpp:796

        if (pal::strcmp(option, W("c")) == 0 || (pal::strcmp(option, W("clr-path")) == 0))
        {
            i++;
            if (i < argc)
            {
                config.clr_path = argv[i];
            }
            else
            {
                pal::fprintf(stderr, W("Option %s: missing path\n"), arg);
                break;
            }
        }
        else if (pal::strcmp(option, W("p")) == 0 || (pal::strcmp(option, W("property")) == 0))
        {
            i++;
            if (i >= argc)
            {
                pal::fprintf(stderr, W("Option %s: missing property\n"), arg);
                break;
            }

            string_t prop = argv[i];
            size_t delim_maybe = prop.find(W('='));
            if (delim_maybe == string_t::npos)
            {
                pal::fprintf(stderr, W("Option %s: '%s' missing property value\n"), arg, prop.c_str());
                break;
            }

            string_t key = prop.substr(0, delim_maybe);
            string_t value = prop.substr(delim_maybe + 1);
            config.user_defined_keys.push_back(std::move(key));
            config.user_defined_values.push_back(std::move(value));
        }
        else if (pal::strcmp(option, W("l")) == 0 || (pal::strcmp(option, W("preload")) == 0))
        {

View on GitHub (pinned to 60108ba66e)