dotnet/orleans · error · OrleansConfigurationException

Invalid {nameof(AdoNetReminderTableOptions)} values for {nam

Error message

Invalid {nameof(AdoNetReminderTableOptions)} values for {nameof(AdoNetReminderTable)}. Configure exactly one of {nameof(options.ConnectionString)} or {nameof(options.DataSource)}.

What it means

Thrown by the ADO.NET reminders options validator when both ConnectionString and DataSource are set, or neither is. The reminder table needs exactly one connection source. The equality check fires for both the all-unset and both-set cases.

Source

Thrown at src/AdoNet/Orleans.Reminders.AdoNet/ReminderService/AdoNetReminderTableOptionsValidator.cs:29

    {
        private readonly AdoNetReminderTableOptions options;
        
        public AdoNetReminderTableOptionsValidator(IOptions<AdoNetReminderTableOptions> options)
        {
            this.options = options.Value;
        }

        /// <inheritdoc />
        public void ValidateConfiguration()
        {
            if (string.IsNullOrWhiteSpace(this.options.Invariant))
            {
                throw new OrleansConfigurationException($"Invalid {nameof(AdoNetReminderTableOptions)} values for {nameof(AdoNetReminderTable)}. {nameof(options.Invariant)} is required.");
            }

            if (string.IsNullOrWhiteSpace(this.options.ConnectionString) == (this.options.DataSource is null))
            {
                throw new OrleansConfigurationException($"Invalid {nameof(AdoNetReminderTableOptions)} values for {nameof(AdoNetReminderTable)}. Configure exactly one of {nameof(options.ConnectionString)} or {nameof(options.DataSource)}.");
            }
        }
    }
}

View on GitHub (pinned to fca799fa70)

Solutions

  1. Provide exactly one of options.ConnectionString or options.DataSource.
  2. Remove the redundant field if migrating between the two.
  3. Confirm the appsettings.json reminders section has exactly one connection field.

Example fix

// before
builder.UseAdoNetReminders(o =>
{
    o.Invariant = AdoNetInvariants.InvariantNameSqlServer;
});

// after
builder.UseAdoNetReminders(o =>
{
    o.Invariant = AdoNetInvariants.InvariantNameSqlServer;
    o.ConnectionString = "Server=.;Database=Orleans;Trusted_Connection=True;";
});
Defensive patterns

Strategy: validation

Validate before calling

static void CheckReminderConnection(AdoNetReminderTableOptions o)
{
    var exactlyOne = string.IsNullOrWhiteSpace(o.ConnectionString) != (o.DataSource is null);
    if (!exactlyOne)
        throw new InvalidOperationException("Set exactly one of ConnectionString or DataSource for reminders.");
}

Prevention

When it happens

Trigger: ValidateConfiguration() runs on AdoNetReminderTableOptions where IsNullOrWhiteSpace(ConnectionString) equals (DataSource is null). Occurs when only Invariant is set, or when both a ConnectionString and DbDataSource are supplied.

Common situations: Configuring reminders with Invariant but no connection; providing both a ConnectionString and a DataSource; mid-migration leaving both populated.

Related errors


AI-assisted analysis of dotnet/orleans@fca799fa70 (2026-08-13). Data as JSON: /api/errors/ee62dd0448fe649f. Report an issue: GitHub.