{"record":{"id":"a0675b2ac8251f3a","repo":"abpframework/abp","slug":"no-blob-storage-provider-was-used-at-least-one-pr","errorCode":null,"errorMessage":"No BLOB Storage provider was used! At least one provider must be configured to be able to use the BLOB Storing System.","messagePattern":"No BLOB Storage provider was used! At least one provider must be configured to be able to use the BLOB Storing System\\.","errorType":"exception","errorClass":"AbpException","httpStatus":null,"severity":"error","filePath":"framework/src/Volo.Abp.BlobStoring/Volo/Abp/BlobStoring/DefaultBlobProviderSelector.cs","lineNumber":38,"sourceCode":"        ConfigurationProvider = configurationProvider;\n        BlobProviders = blobProviders;\n    }\n\n    [NotNull]\n    public virtual IBlobProvider Get([NotNull] string containerName)\n    {\n        Check.NotNull(containerName, nameof(containerName));\n\n        var configuration = ConfigurationProvider.Get(containerName);\n\n        if (!BlobProviders.Any())\n        {\n            throw new AbpException(\"No BLOB Storage provider was registered! At least one provider must be registered to be able to use the BLOB Storing System.\");\n        }\n\n        if (configuration.ProviderType == null)\n        {\n            throw new AbpException(\"No BLOB Storage provider was used! At least one provider must be configured to be able to use the BLOB Storing System.\");\n        }\n\n        foreach (var provider in BlobProviders)\n        {\n            if (ProxyHelper.GetUnProxiedType(provider).IsAssignableTo(configuration.ProviderType))\n            {\n                return provider;\n            }\n        }\n\n        throw new AbpException(\n            $\"Could not find the BLOB Storage provider with the type ({configuration.ProviderType.AssemblyQualifiedName}) configured for the container {containerName} and no default provider was set.\"\n        );\n    }\n}\n","sourceCodeStart":20,"sourceCodeEnd":54,"githubUrl":"https://github.com/abpframework/abp/blob/7ed43b1931b9df46a50c0c59148a18645641d0df/framework/src/Volo.Abp.BlobStoring/Volo/Abp/BlobStoring/DefaultBlobProviderSelector.cs#L20-L54","documentation":"Thrown when at least one IBlobProvider is registered, but the specific container being resolved has no ProviderType configured (configuration.ProviderType == null). ProviderType is set by the Use* extension methods (UseFileSystemStorage, UseAzureBlobStorage, etc.); a null value means the container was declared without a backing provider, or a default provider was never set.","triggerScenarios":"DefaultBlobProviderSelector.Get(containerName) runs after BlobProviders is non-empty, but ConfigurationProvider.Get(containerName).ProviderType is null. Happens when a container is used without configuring it, and no default ProviderType is configured for all containers.","commonSituations":"Using IBlobContainer<T> without calling the Use<Provider> extension on its configuration; defining a default container configuration that omits the provider; typo in container name causing it to resolve an unconfigured default; mixing configured and unconfigured containers.","solutions":["Configure the container's provider via Configure<AbpBlobStoringOptions>(o => o.Containers.Configure<MyContainer>(c => c.UseFileSystemStorage())) or the typed extension.","Set a default provider for all containers with o.Containers.ConfigureDefault(c => c.Use<ProviderType>()).","Confirm the container name attribute matches the configuration key you are configuring.","Ensure the Use* extension for your chosen provider is actually invoked at module configuration time."],"exampleFix":"// before: container used without a provider type\nConfigure<AbpBlobStoringOptions>(options =>\n{\n    options.Containers.Configure<MyFileContainer>(c => { /* no Use* call */ });\n});\n\n// after: specify the provider for the container\nConfigure<AbpBlobStoringOptions>(options =>\n{\n    options.Containers.Configure<MyFileContainer>(c => c.UseFileSystemStorage());\n});","handlingStrategy":"validation","validationCode":"// Confirm the container has a ProviderType configured before first use.\nvar config = configurationProvider.Get(containerName);\nif (config.ProviderType == null)\n{\n    throw new InvalidOperationException($\"Container '{containerName}' has no ProviderType. Call a Use* extension (e.g., UseFileSystemStorage) or configure a default provider.\");\n}","typeGuard":"public static bool ContainerHasProviderType(BlobContainerConfiguration config) =>\n    config.ProviderType is not null;","tryCatchPattern":"try\n{\n    provider = selector.Get(containerName);\n}\ncatch (AbpException ex) when (ex.Message.Contains(\"No BLOB Storage provider was used\", StringComparison.Ordinal))\n{\n    logger.LogError(ex, \"Container {Name} lacks a provider configuration.\", containerName);\n    throw;\n}","preventionTips":["Always pair a container declaration with its Use<Provider> configuration call.","Set a default provider via ConfigureDefault to cover unconfigured containers.","Validate container configurations in a module post-configure hook.","Use the same container name in the attribute and the configuration to avoid silent unconfigured lookups."],"tags":["blob-storing","configuration","provider-selection"],"backgroundTag":null,"analyzedSha":"7ed43b1931b9df46a50c0c59148a18645641d0df","analyzedAt":"2026-08-13T16:26:11.351Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}