{"record":{"id":"574cb7eb3f579fa7","repo":"dotnet/reactive","slug":"settings-are-invalid-rxpackagesvalidationresult-message","errorCode":null,"errorMessage":"Settings are invalid: {rxPackagesValidationResult.Message}","messagePattern":"Settings are invalid: (.+?)","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"Rx.NET/Test/Gauntlet/RxGauntlet.Common/CommandLine/RxSourceSettings.cs","lineNumber":60,"sourceCode":"    public PackageIdAndVersion[] RxUiFrameworkPackagesParsed\n    {\n        get\n        {\n            if (_parsedRxUiFrameworkPackages is not null)\n            {\n                return _parsedRxUiFrameworkPackages;\n            }\n\n            if (RxUiFrameworkPackages.Length == 0)\n            {\n                _parsedRxUiFrameworkPackages = [];\n            }\n            else\n            {\n                var rxPackagesValidationResult = Validate();\n                if (!rxPackagesValidationResult.Successful)\n                {\n                    throw new InvalidOperationException($\"Settings are invalid: {rxPackagesValidationResult.Message}\");\n                }\n\n                Debug.Assert(_parsedRxUiFrameworkPackages is not null, \"RxPackagesParsed should have been set by ValidateRxPackages.\");\n            }\n\n            return _parsedRxUiFrameworkPackages;\n        }\n    }\n\n    /// <summary>\n    /// Gets all of the Rx packages, starting with the one in <see cref=\"RxMainPackageParsed\"/>, and then,\n    /// if present, <see cref=\"RxLegacyPackageParsed\"/>, followed by <see cref=\"RxUiFrameworkPackagesParsed\"/>.\n    /// </summary>\n    /// <returns></returns>\n    public PackageIdAndVersion[] GetAllParsedPackages() =>\n        [\n            RxMainPackageParsed,\n","sourceCodeStart":42,"sourceCodeEnd":78,"githubUrl":"https://github.com/dotnet/reactive/blob/94b5d5ab912789f5abe9a72138a25bbd716fe59c/Rx.NET/Test/Gauntlet/RxGauntlet.Common/CommandLine/RxSourceSettings.cs#L42-L78","documentation":"RxSourceSettings lazy-parses its package properties; when the parsed package cache is still unset it runs Validate() and throws InvalidOperationException if validation reported a failure (e.g. bad package spec). The message embeds the validation result message so you see the underlying reason. It guards the invariant that parsed Rx/UI framework packages exist before returning them.","triggerScenarios":"Accessing the parsed Rx UI framework packages getter (RxPackagesParsed path) when Validate() returned unsuccessful — typically because RxMainPackage or RxUiFrameworkPackages was set to a malformed value like 'System.Reactive' without the required '<PackageId>,<Version>' format.","commonSituations":"Command-line wiring of the Rx Gauntlet tool with a mistyped --rx-main-package argument, missing version part in a package spec, or Spectre.Console settings used outside the normal command parsing path so defaults were never applied.","solutions":["Fix the package specification passed via command line to '<PackageId>,<Version>' format, e.g. System.Reactive,6.0.1","Run the settings through Validate() or Spectre.Console's own validation before use to get the failure message early","Ensure RxSourceSettings is only constructed/populated through the Spectre.Console command pipeline that guarantees non-null properties"],"exampleFix":"// before\ndotnet run -- --rx-main-package System.Reactive\n// after\ndotnet run -- --rx-main-package System.Reactive,6.0.1","handlingStrategy":"validation","validationCode":"var result = settings.Validate();\nif (!result.Successful) { Console.WriteLine($\"Fix settings first: {result.Message}\"); return 1; }","typeGuard":"if (settings.RxMainPackage is not string main || string.IsNullOrEmpty(main) || !main.Contains(',')) { /* reject before use */ }","tryCatchPattern":"try { var parsed = settings.RxPackagesParsed; }\ncatch (InvalidOperationException ex) when (ex.Message.StartsWith(\"Settings are invalid\")) { logger.LogError(ex.Message); }","preventionTips":["Always pass package ids as '<PackageId>,<Version>'","Run Validate() early, right after command binding","Rely on Spectre.Console command binding instead of manual construction"],"tags":["csharp","invalid-operation-exception","validation","command-line"],"backgroundTag":"invalid-config-value","analyzedSha":"94b5d5ab912789f5abe9a72138a25bbd716fe59c","analyzedAt":"2026-09-15T02:26:24.759Z","contentChangedAt":"2026-09-15T02:26:24.759Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}