{"record":{"id":"319c33154c34396e","repo":"stride3d/stride","slug":"unexpected-arguments-0-program","errorCode":null,"errorMessage":"Unexpected arguments [{0}]","messagePattern":"Unexpected arguments \\[(.+?)\\]","errorType":"console","errorClass":"OptionException","httpStatus":null,"severity":"error","filePath":"sources/engine/Stride.Debugger/Program.cs","lineNumber":50,"sourceCode":"                    \"{0}.{1}.{2}\",\n                    typeof(Program).Assembly.GetName().Version.Major,\n                    typeof(Program).Assembly.GetName().Version.Minor,\n                    typeof(Program).Assembly.GetName().Version.Build) + string.Empty,\n                string.Format(\"Usage: {0} --host=[hostpipe]\", exeName),\n                string.Empty,\n                \"=== Options ===\",\n                string.Empty,\n                { \"h|help\", \"Show this message and exit\", v => showHelp = v != null },\n                { \"host=\", \"Host pipe\", v => hostPipe = v },\n                { \"wait-debugger-attach\", \"Process will wait for a debuggger to attach, for 5 seconds\", v => waitDebuggerAttach = true },\n            };\n\n            try\n            {\n                var unexpectedArgs = p.Parse(args);\n                if (unexpectedArgs.Any())\n                {\n                    throw new OptionException(\"Unexpected arguments [{0}]\".ToFormat(string.Join(\", \", unexpectedArgs)), \"args\");\n                }\n\n                if (waitDebuggerAttach)\n                {\n                    // Wait for 2 second max\n                    for (int i = 0; i < 500; ++i)\n                    {\n                        if (System.Diagnostics.Debugger.IsAttached)\n                        {\n                            break;\n                        }\n\n                        Thread.Sleep(10);\n                    }\n                }\n\n                if (hostPipe == null)\n                {","sourceCodeStart":32,"sourceCodeEnd":68,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/engine/Stride.Debugger/Program.cs#L32-L68","documentation":"Program.Main parses command-line options with an options parser (p.Parse). Any arguments that are not recognized declared options are returned as 'unexpectedArgs'; if any remain, Main throws OptionException naming the offending argument list. This is a strict fail-fast policy for the Stride debugger executable's CLI.","triggerScenarios":"Launching Stride.Debugger.exe with extra/misspelled command-line tokens, e.g. a typo like --hos instead of --host, or a stray positional argument; p.Parse returns them as unexpected and Main throws at Program.cs:50.","commonSituations":"Hand-editing the editor's debugger launch command; IDE launch profiles with stale arguments; scripts passing quoted paths incorrectly so they split into extra tokens; upgrading Stride where an old option was removed.","solutions":["Remove or correct the unexpected arguments shown in the message (they are listed between the brackets).","Use only documented options, e.g. --host <pipeName> and --wait-for-debugger-attach if available.","Check the editor-generated launch command / profile for stale or duplicated arguments.","Run Stride.Debugger with --help (or inspect Program.cs options setup) to list valid flags."],"exampleFix":"// before\nStride.Debugger.exe --host pipeName --verbose extraArg\n\n// after\nStride.Debugger.exe --host pipeName","handlingStrategy":"validation","validationCode":"// Validate the command line before launching\ndef launch(debuggerPath, args):\n    allowed = {'--host', '--wait-debugger-attach'}\n    unknown = {a for a in args if a.startswith('--') and a not in allowed}\n    assert not unknown, f\"Unexpected debugger args: {unknown}\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Only launch Stride.Debugger via the Stride editor launcher","Keep launch profiles in sync with the current Stride version's supported flags","Quote paths with spaces so they don't split into extra tokens"],"tags":["cli","arguments","parsing","startup"],"backgroundTag":"invalid-cli-argument","analyzedSha":"96fad776d210c221682aac1ccdf4c79dc046fc38","analyzedAt":"2026-09-14T02:59:31.279Z","contentChangedAt":"2026-09-14T02:59:31.279Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}