dotnet/reactive · error · InvalidOperationException
Settings are invalid: {rxPackagesValidationResult.Message}
Error message
Settings are invalid: {rxPackagesValidationResult.Message} What it means
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.
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
Example fix
// before dotnet run -- --rx-main-package System.Reactive // after dotnet run -- --rx-main-package System.Reactive,6.0.1
Defensive patterns
Strategy: validation
Validate before calling
var result = settings.Validate();
if (!result.Successful) { Console.WriteLine($"Fix settings first: {result.Message}"); return 1; } Type guard
if (settings.RxMainPackage is not string main || string.IsNullOrEmpty(main) || !main.Contains(',')) { /* reject before use */ } Try / catch
try { var parsed = settings.RxPackagesParsed; }
catch (InvalidOperationException ex) when (ex.Message.StartsWith("Settings are invalid")) { logger.LogError(ex.Message); } Prevention
- Always pass package ids as '<PackageId>,<Version>'
- Run Validate() early, right after command binding
- Rely on Spectre.Console command binding instead of manual construction
When it happens
Trigger: 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.
Common situations: 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.
Understand the failure class
Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.
Related errors
- Value cannot be null. (Parameter 'onCompletedAsync')
- Value cannot be null. (Parameter 'onNext')
- Value cannot be null. (Parameter 'onError')
- Value cannot be null. (Parameter 'disposable')
- Value cannot be null. (Parameter 'disposable')
AI-assisted analysis of dotnet/reactive@94b5d5ab91 (2026-09-15).
Data as JSON: /api/errors/574cb7eb3f579fa7.
Report an issue: GitHub.
Appendix: source
Thrown at Rx.NET/Test/Gauntlet/RxGauntlet.Common/CommandLine/RxSourceSettings.cs:60
public PackageIdAndVersion[] RxUiFrameworkPackagesParsed
{
get
{
if (_parsedRxUiFrameworkPackages is not null)
{
return _parsedRxUiFrameworkPackages;
}
if (RxUiFrameworkPackages.Length == 0)
{
_parsedRxUiFrameworkPackages = [];
}
else
{
var rxPackagesValidationResult = Validate();
if (!rxPackagesValidationResult.Successful)
{
throw new InvalidOperationException($"Settings are invalid: {rxPackagesValidationResult.Message}");
}
Debug.Assert(_parsedRxUiFrameworkPackages is not null, "RxPackagesParsed should have been set by ValidateRxPackages.");
}
return _parsedRxUiFrameworkPackages;
}
}
/// <summary>
/// Gets all of the Rx packages, starting with the one in <see cref="RxMainPackageParsed"/>, and then,
/// if present, <see cref="RxLegacyPackageParsed"/>, followed by <see cref="RxUiFrameworkPackagesParsed"/>.
/// </summary>
/// <returns></returns>
public PackageIdAndVersion[] GetAllParsedPackages() =>
[
RxMainPackageParsed,
View on GitHub (pinned to 94b5d5ab91)