{"record":{"id":"ee62dd0448fe649f","repo":"dotnet/orleans","slug":"invalid-nameof-adonetremindertableoptions-value-ee62dd","errorCode":null,"errorMessage":"Invalid {nameof(AdoNetReminderTableOptions)} values for {nameof(AdoNetReminderTable)}. Configure exactly one of {nameof(options.ConnectionString)} or {nameof(options.DataSource)}.","messagePattern":"Invalid (.+?) values for (.+?)\\. Configure exactly one of (.+?) or (.+?)\\.","errorType":"validation","errorClass":"OrleansConfigurationException","httpStatus":null,"severity":"error","filePath":"src/AdoNet/Orleans.Reminders.AdoNet/ReminderService/AdoNetReminderTableOptionsValidator.cs","lineNumber":29,"sourceCode":"    {\n        private readonly AdoNetReminderTableOptions options;\n        \n        public AdoNetReminderTableOptionsValidator(IOptions<AdoNetReminderTableOptions> options)\n        {\n            this.options = options.Value;\n        }\n\n        /// <inheritdoc />\n        public void ValidateConfiguration()\n        {\n            if (string.IsNullOrWhiteSpace(this.options.Invariant))\n            {\n                throw new OrleansConfigurationException($\"Invalid {nameof(AdoNetReminderTableOptions)} values for {nameof(AdoNetReminderTable)}. {nameof(options.Invariant)} is required.\");\n            }\n\n            if (string.IsNullOrWhiteSpace(this.options.ConnectionString) == (this.options.DataSource is null))\n            {\n                throw new OrleansConfigurationException($\"Invalid {nameof(AdoNetReminderTableOptions)} values for {nameof(AdoNetReminderTable)}. Configure exactly one of {nameof(options.ConnectionString)} or {nameof(options.DataSource)}.\");\n            }\n        }\n    }\n}","sourceCodeStart":11,"sourceCodeEnd":33,"githubUrl":"https://github.com/dotnet/orleans/blob/fca799fa70ecb6ad975224271703ca43221f58de/src/AdoNet/Orleans.Reminders.AdoNet/ReminderService/AdoNetReminderTableOptionsValidator.cs#L11-L33","documentation":"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.","triggerScenarios":"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.","commonSituations":"Configuring reminders with Invariant but no connection; providing both a ConnectionString and a DataSource; mid-migration leaving both populated.","solutions":["Provide exactly one of options.ConnectionString or options.DataSource.","Remove the redundant field if migrating between the two.","Confirm the appsettings.json reminders section has exactly one connection field."],"exampleFix":"// before\nbuilder.UseAdoNetReminders(o =>\n{\n    o.Invariant = AdoNetInvariants.InvariantNameSqlServer;\n});\n\n// after\nbuilder.UseAdoNetReminders(o =>\n{\n    o.Invariant = AdoNetInvariants.InvariantNameSqlServer;\n    o.ConnectionString = \"Server=.;Database=Orleans;Trusted_Connection=True;\";\n});","handlingStrategy":"validation","validationCode":"static void CheckReminderConnection(AdoNetReminderTableOptions o)\n{\n    var exactlyOne = string.IsNullOrWhiteSpace(o.ConnectionString) != (o.DataSource is null);\n    if (!exactlyOne)\n        throw new InvalidOperationException(\"Set exactly one of ConnectionString or DataSource for reminders.\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Standardize one connection strategy across ADO.NET subsystems.","Add a startup assertion for exactly-one connection source.","Remove the redundant field atomically during migration."],"tags":["configuration","adonet","reminders","connection-string","startup-validation"],"backgroundTag":null,"analyzedSha":"fca799fa70ecb6ad975224271703ca43221f58de","analyzedAt":"2026-08-13T19:55:57.938Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}