dotnet/runtime · warning

Option %s: missing property

Error message

Option %s: missing property

What it means

Printed by parse_args() when -p / --property is the LAST token (i >= argc after i++). The option needs a following 'key=value' argument that is absent. Parsing breaks and returns false.

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 290d5ab72c)

Solutions

  1. Provide the property as 'key=value' immediately after -p, e.g. 'corerun -p System.GC.Server=true App.dll'.
  2. Quote the whole key=value if the value has spaces: -p "FancyProp=/usr/first last/root".
  3. Repeat -p for multiple properties; don't leave a trailing -p.

Example fix

# before
corerun -p App.dll
# after
corerun -p System.GC.Server=true App.dll
Defensive patterns

Strategy: validation

Validate before calling

# ensure -p/--property is never the trailing token
if [ "${@: -1}" = "-p" ] || [ "${@: -1}" = "--property" ]; then
  echo '-p requires a following key=value'; exit 2
fi

Prevention

When it happens

Trigger: User runs 'corerun -p' with nothing after, or '--property' as the final token before where the assembly would go.

Common situations: Forgotten property value; copy-paste from docs that broke the line before the value; trailing -p at end of command.

Related errors


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