{"record":{"id":"9d431def13a5749c","repo":"dotnet/orleans","slug":"value-cannot-be-null-parameter-createclientcall-9d431d","errorCode":null,"errorMessage":"Value cannot be null. (Parameter 'createClientCallback')","messagePattern":"Value cannot be null\\. \\(Parameter 'createClientCallback'\\)","errorType":"exception","errorClass":"ArgumentNullException","httpStatus":null,"severity":"error","filePath":"src/Azure/Shared/Storage/AzureStorageOperationOptions.cs","lineNumber":93,"sourceCode":"            SetTableServiceClient(connectionString);\n        }\n\n        /// <summary>\n        /// Configures the <see cref=\"TableServiceClient\"/> using an authenticated service URI.\n        /// </summary>\n        [Obsolete($\"Set the {nameof(TableServiceClient)} property directly.\")]\n        public void ConfigureTableServiceClient(Uri serviceUri)\n        {\n            SetTableServiceClient(serviceUri);\n        }\n\n        /// <summary>\n        /// Configures the <see cref=\"TableServiceClient\"/> using the provided callback.\n        /// </summary>\n        [Obsolete($\"Set the {nameof(TableServiceClient)} property directly.\")]\n        public void ConfigureTableServiceClient(Func<Task<TableServiceClient>> createClientCallback)\n        {\n            CreateClient = createClientCallback ?? throw new ArgumentNullException(nameof(createClientCallback));\n        }\n\n        /// <summary>\n        /// Configures the <see cref=\"TableServiceClient\"/> using an authenticated service URI and a <see cref=\"Azure.Core.TokenCredential\"/>.\n        /// </summary>\n        [Obsolete($\"Set the {nameof(TableServiceClient)} property directly.\")]\n        public void ConfigureTableServiceClient(Uri serviceUri, TokenCredential tokenCredential)\n        {\n            SetTableServiceClient(serviceUri, tokenCredential);\n        }\n\n        /// <summary>\n        /// Configures the <see cref=\"TableServiceClient\"/> using an authenticated service URI and a <see cref=\"Azure.AzureSasCredential\"/>.\n        /// </summary>\n        [Obsolete($\"Set the {nameof(TableServiceClient)} property directly.\")]\n        public void ConfigureTableServiceClient(Uri serviceUri, AzureSasCredential azureSasCredential)\n        {\n            SetTableServiceClient(serviceUri, azureSasCredential);","sourceCodeStart":75,"sourceCodeEnd":111,"githubUrl":"https://github.com/dotnet/orleans/blob/fca799fa70ecb6ad975224271703ca43221f58de/src/Azure/Shared/Storage/AzureStorageOperationOptions.cs#L75-L111","documentation":"Thrown by AzureStorageOperationOptions.ConfigureTableServiceClient(Func<Task<TableServiceClient>>) when the supplied callback is null. This overload is marked [Obsolete] — the supported way is to assign the TableServiceClient property directly. The guard simply prevents a null CreateClient from being stored, which would later fail at Validate().","triggerScenarios":"Calling options.ConfigureTableServiceClient((Func<Task<TableServiceClient>>)null) or passing a variable that was never assigned. Also appears during migration to the SDK-style client where old wiring code passes null unintentionally.","commonSituations":"Migrating off the obsolete Configure* methods; DI configuration that conditionally builds a callback and falls through to null; copy-paste of a sample that omitted the callback.","solutions":["Stop using the obsolete ConfigureTableServiceClient callback overload; set options.TableServiceClient directly.","If you must keep the callback, supply a non-null Func<Task<TableServiceClient>>.","Add a null check / IDE diagnostic around the callback expression so the failure is local."],"exampleFix":"// before (obsolete, throws on null)\noptions.ConfigureTableServiceClient(maybeCallback);\n// after (recommended)\noptions.TableServiceClient = new TableServiceClient(connectionString);","handlingStrategy":"validation","validationCode":"if (createClientCallback is null) throw new ArgumentNullException(nameof(createClientCallback));\noptions.ConfigureTableServiceClient(createClientCallback);","typeGuard":"static bool IsCallbackConfigured(Func<Task<TableServiceClient>>? cb) => cb is not null;","tryCatchPattern":"catch (ArgumentNullException ex) when (ex.ParamName == \"createClientCallback\") { /* supply a real callback or set TableServiceClient directly */ }","preventionTips":["Migrate off the obsolete ConfigureTableServiceClient callback overload; assign TableServiceClient directly.","Suppress obsolete warnings only after migrating."],"tags":["orleans","azure-storage","azure-table","configuration","obsolete","argument"],"backgroundTag":null,"analyzedSha":"fca799fa70ecb6ad975224271703ca43221f58de","analyzedAt":"2026-08-13T19:55:57.938Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}