{"record":{"id":"11e208be2c79c683","repo":"stride3d/stride","slug":"need-one-extra-argument","errorCode":null,"errorMessage":"Need one extra argument","messagePattern":"Need one extra argument","errorType":"validation","errorClass":"OptionException","httpStatus":null,"severity":"error","filePath":"sources/core/Stride.Core.Tasks/Program.cs","lineNumber":87,"sourceCode":"                if (showHelp)\n                {\n                    p.WriteOptionDescriptions(Console.Out);\n                    return 0;\n                }\n\n                // Make sure path exists\n                if (commandArgs.Count == 0)\n                    throw new OptionException(\"You need to specify a command\", \"\");\n\n                switch (commandArgs[0])\n                {\n                    case \"locate-devenv\":\n                    {\n                        if(!OperatingSystem.IsWindows())\n                            throw new OptionException(\"This option is only available on Windows\", \"\");\n                            \n                        if (commandArgs.Count != 2)\n                            throw new OptionException(\"Need one extra argument\", \"\");\n                        var devenvPath = LocateDevenv.FindDevenv(commandArgs[1]);\n                        if (devenvPath == null)\n                        {\n                            Console.WriteLine(\"Could not locate devenv\");\n                            return 1;\n                        }\n                        Console.WriteLine(devenvPath);\n                        break;\n                    }\n                    case \"pack-assets\":\n                    {\n                        if (commandArgs.Count != 3)\n                            throw new OptionException(\"Need two extra arguments\", \"\");\n\n                        var csprojFile = commandArgs[1];\n                        var intermediatePackagePath = commandArgs[2];\n                        // Host-loadable asset assemblies are passed as repeated --pack-asset-assembly= options.\n                        var generatedItems = new List<(string SourcePath, string PackagePath)>();","sourceCodeStart":69,"sourceCodeEnd":105,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/core/Stride.Core.Tasks/Program.cs#L69-L105","documentation":"The locate-devenv command takes exactly one extra argument: the Visual Studio version to search for. RealMain requires commandArgs.Count == 2 (command + one argument) and throws OptionException otherwise.","triggerScenarios":"Running 'Stride.Core.Tasks locate-devenv' with zero additional arguments, or with more than one.","commonSituations":"Forgetting the VS version argument in a script; word-splitting in shell causing unexpected argument counts.","solutions":["Supply exactly one argument: the Visual Studio version, e.g. 'locate-devenv 17'.","Quote the argument if it contains spaces.","Check the script for accidental extra/missing tokens in the invocation."],"exampleFix":"// before\nStride.Core.Tasks locate-devenv\n// after\nStride.Core.Tasks locate-devenv 17","handlingStrategy":"validation","validationCode":"if (args.Length != 2 || args[0] != \"locate-devenv\")\n{\n    Console.WriteLine(\"Usage: Stride.Core.Tasks locate-devenv <vsVersion>\");\n    return 1;\n}","typeGuard":null,"tryCatchPattern":"try { return RealMain(args); }\ncatch (OptionException ex) { Console.Error.WriteLine(\"Usage: locate-devenv <vsVersion>\"); return 1; }","preventionTips":["Pass exactly one version argument","Quote arguments with spaces","Verify argument counts in wrapper scripts"],"tags":["cli","missing-argument"],"backgroundTag":"missing-required-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"}