{"record":{"id":"81561ef2cf620850","repo":"dotnet/orleans","slug":"value-cannot-be-null-parameter-options","errorCode":null,"errorMessage":"Value cannot be null. (Parameter 'options')","messagePattern":"Value cannot be null\\. \\(Parameter 'options'\\)","errorType":"exception","errorClass":"ArgumentNullException","httpStatus":null,"severity":"error","filePath":"src/Azure/Shared/Storage/AzureTableDataManager.cs","lineNumber":62,"sourceCode":"\n        /// <summary> Name of the table this instance is managing. </summary>\n        public string TableName { get; }\n\n        /// <summary> Logger for this table manager instance. </summary>\n        protected internal ILogger Logger { get; }\n\n        public AzureStoragePolicyOptions StoragePolicyOptions { get; }\n\n        public TableClient Table { get; private set; } = null!;\n\n        /// <summary>\n        /// Creates a new <see cref=\"AzureTableDataManager{T}\"/> instance.\n        /// </summary>\n        /// <param name=\"options\">Storage configuration.</param>\n        /// <param name=\"logger\">Logger to use.</param>\n        public AzureTableDataManager(AzureStorageOperationOptions options, ILogger logger)\n        {\n            this.options = options ?? throw new ArgumentNullException(nameof(options));\n\n            Logger = logger ?? throw new ArgumentNullException(nameof(logger));\n            TableName = options.TableName ?? throw new ArgumentNullException(nameof(options.TableName));\n            StoragePolicyOptions = options.StoragePolicyOptions ?? throw new ArgumentNullException(nameof(options.StoragePolicyOptions));\n\n            AzureTableUtils.ValidateTableName(TableName);\n        }\n\n        /// <summary>\n        /// Connects to, or creates and initializes a new Azure table if it does not already exist.\n        /// </summary>\n        /// <returns>Completion promise for this operation.</returns>\n        public async Task InitTableAsync()\n        {\n            const string operation = \"InitTable\";\n            var startTime = DateTime.UtcNow;\n\n            try","sourceCodeStart":44,"sourceCodeEnd":80,"githubUrl":"https://github.com/dotnet/orleans/blob/fca799fa70ecb6ad975224271703ca43221f58de/src/Azure/Shared/Storage/AzureTableDataManager.cs#L44-L80","documentation":"Thrown by the AzureTableDataManager<T> constructor when the options argument is null. The manager cannot function without storage configuration, so construction fails immediately rather than later during InitTableAsync.","triggerScenarios":"Constructing AzureTableDataManager<T> directly with a null AzureStorageOperationOptions, or a DI/factory path that resolves options to null.","commonSituations":"Custom provider that news up the manager without resolving options from DI; tests that pass null accidentally; refactoring that moved options resolution.","solutions":["Pass a fully configured, non-null AzureStorageOperationOptions.","Resolve options from DI rather than constructing by hand.","Null-check at the call site with a clearer message if needed."],"exampleFix":"// before\nvar mgr = new AzureTableDataManager<MyEntity>(options, logger); // options null\n// after\nvar opts = services.GetRequiredService<AzureStorageOperationOptions>();\nvar mgr = new AzureTableDataManager<MyEntity>(opts ?? throw new InvalidOperationException(\"options not registered\"), logger);","handlingStrategy":"validation","validationCode":"var opts = options ?? throw new ArgumentNullException(nameof(options));\nvar mgr = new AzureTableDataManager<T>(opts, logger);","typeGuard":"static bool HasOptions(AzureStorageOperationOptions? o) => o is not null;","tryCatchPattern":"catch (ArgumentNullException ex) when (ex.ParamName == \"options\") { /* resolve options from DI */ }","preventionTips":["Resolve AzureStorageOperationOptions from DI rather than constructing by hand.","Null-check at the call site with a domain-specific message."],"tags":["orleans","azure-storage","azure-table","argument"],"backgroundTag":null,"analyzedSha":"fca799fa70ecb6ad975224271703ca43221f58de","analyzedAt":"2026-08-13T19:55:57.938Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}