{"record":{"id":"270452afec3bf255","repo":"dotnet/orleans","slug":"invalid-nameof-adonetremindertableoptions-value","errorCode":null,"errorMessage":"Invalid {nameof(AdoNetReminderTableOptions)} values for {nameof(AdoNetReminderTable)}. {nameof(options.Invariant)} is required.","messagePattern":"Invalid (.+?) values for (.+?)\\. (.+?) is required\\.","errorType":"validation","errorClass":"OrleansConfigurationException","httpStatus":null,"severity":"error","filePath":"src/AdoNet/Orleans.Reminders.AdoNet/ReminderService/AdoNetReminderTableOptionsValidator.cs","lineNumber":24,"sourceCode":"{\n    /// <summary>\n    /// Validates <see cref=\"AdoNetReminderTableOptions\"/> configuration.\n    /// </summary>\n    public class AdoNetReminderTableOptionsValidator : IConfigurationValidator\n    {\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":6,"sourceCodeEnd":33,"githubUrl":"https://github.com/dotnet/orleans/blob/fca799fa70ecb6ad975224271703ca43221f58de/src/AdoNet/Orleans.Reminders.AdoNet/ReminderService/AdoNetReminderTableOptionsValidator.cs#L6-L33","documentation":"Thrown by the ADO.NET reminders options validator when Invariant is null or whitespace. AdoNetReminderTableOptions.Invariant has no default, so it must be set explicitly for the reminder service to know which database driver and query dialect to use.","triggerScenarios":"ValidateConfiguration() runs on AdoNetReminderTableOptions with a blank Invariant. Triggered at host startup when UseAdoNetReminders is registered without setting Invariant.","commonSituations":"Registering reminders with only a connection string; assuming the reminder table shares the clustering Invariant; copy-paste from storage config that has a default Invariant.","solutions":["Set options.Invariant = AdoNetInvariants.InvariantNameSqlServer (or the relevant driver).","Use the UseAdoNetReminders overload that accepts a configure delegate and set Invariant there.","Ensure the reminders section in appsettings.json contains an Invariant key."],"exampleFix":"// before\nbuilder.UseAdoNetReminders(o =>\n{\n    o.ConnectionString = \"Server=.;Database=Orleans;\";\n});\n\n// after\nbuilder.UseAdoNetReminders(o =>\n{\n    o.Invariant = AdoNetInvariants.InvariantNameSqlServer;\n    o.ConnectionString = \"Server=.;Database=Orleans;\";\n});","handlingStrategy":"validation","validationCode":"static void CheckReminderInvariant(AdoNetReminderTableOptions o)\n{\n    if (string.IsNullOrWhiteSpace(o.Invariant))\n        throw new InvalidOperationException(\"AdoNetReminderTableOptions.Invariant is required.\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Set Invariant explicitly for reminders — it has no default.","Reference AdoNetInvariants constants to avoid typos.","Add a config test asserting the reminders Invariant is non-blank."],"tags":["configuration","adonet","reminders","invariant","startup-validation"],"backgroundTag":null,"analyzedSha":"fca799fa70ecb6ad975224271703ca43221f58de","analyzedAt":"2026-08-13T19:55:57.938Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}