{"record":{"id":"159bd1cbfbf939ef","repo":"SignalR/SignalR","slug":"value-159bd1","errorCode":null,"errorMessage":"value","messagePattern":"value","errorType":"validation","errorClass":"ArgumentOutOfRangeException","httpStatus":null,"severity":"error","filePath":"src/Microsoft.AspNet.SignalR.SqlServer/SqlScaleoutConfiguration.cs","lineNumber":46,"sourceCode":"        /// </summary>\n        public string ConnectionString { get; private set; }\n\n        /// <summary>\n        /// The number of tables to store messages in. Using more tables reduces lock contention and may increase throughput.\n        /// This must be consistent between all nodes in the web farm.\n        /// Defaults to 1.\n        /// </summary>\n        public int TableCount\n        {\n            get\n            {\n                return _tableCount;\n            }\n            set\n            {\n                if (value < 1)\n                {\n                    throw new ArgumentOutOfRangeException(\"value\");\n                }\n                _tableCount = value;\n            }\n        }\n    }\n}\n","sourceCodeStart":28,"sourceCodeEnd":53,"githubUrl":"https://github.com/SignalR/SignalR/blob/693053b89a9e1f5ce819e3233ed159a6409de22b/src/Microsoft.AspNet.SignalR.SqlServer/SqlScaleoutConfiguration.cs#L28-L53","documentation":"ArgumentOutOfRangeException on the TableCount setter: the SQL backplane needs at least one message table, so any value < 1 is rejected. TableCount controls how many Messages_N tables are created to reduce lock contention across farm nodes.","triggerScenarios":"config.TableCount = 0 (or any negative value) is assigned, hitting the guard at SqlScaleoutConfiguration.cs:46.","commonSituations":"TableCount is read from a config setting that defaults to 0; a calculation that can yield zero (e.g. based on CPU/instance count) is wired into TableCount; an off-by-one when scaling down.","solutions":["Set TableCount to a positive integer (1 is the default and minimum).","Clamp any computed value to at least 1 before assigning.","Validate the config-sourced value at startup."],"exampleFix":"// before\nconfig.TableCount = desiredTables; // desiredTables is 0 -> throw\n\n// after\nconfig.TableCount = Math.Max(1, desiredTables);","handlingStrategy":"validation","validationCode":"int tableCount = Math.Max(1, desiredTableCount);\nconfig.TableCount = tableCount;","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Clamp any computed TableCount to at least 1.","Default config-sourced values to 1, not 0.","Validate the setting at startup before it reaches the setter."],"tags":["sqlserver","argument-out-of-range","configuration","validation"],"backgroundTag":null,"analyzedSha":"693053b89a9e1f5ce819e3233ed159a6409de22b","analyzedAt":"2026-08-13T22:23:59.793Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}