{"record":{"id":"871c8e08c6ddf66f","repo":"abpframework/abp","slug":"no-blob-storage-provider-was-registered-at-least","errorCode":null,"errorMessage":"No BLOB Storage provider was registered! At least one provider must be registered to be able to use the BLOB Storing System.","messagePattern":"No BLOB Storage provider was registered! At least one provider must be registered to be able to use the BLOB Storing System\\.","errorType":"exception","errorClass":"AbpException","httpStatus":null,"severity":"critical","filePath":"framework/src/Volo.Abp.BlobStoring/Volo/Abp/BlobStoring/DefaultBlobProviderSelector.cs","lineNumber":33,"sourceCode":"\n    public DefaultBlobProviderSelector(\n        IBlobContainerConfigurationProvider configurationProvider,\n        IEnumerable<IBlobProvider> blobProviders)\n    {\n        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        );","sourceCodeStart":15,"sourceCodeEnd":51,"githubUrl":"https://github.com/abpframework/abp/blob/7ed43b1931b9df46a50c0c59148a18645641d0df/framework/src/Volo.Abp.BlobStoring/Volo/Abp/BlobStoring/DefaultBlobProviderSelector.cs#L15-L51","documentation":"Thrown by DefaultBlobProviderSelector.Get when the IBlobProvider collection resolved from DI is completely empty. The Blob Storing System requires at least one backing provider (file system, database, Azure, AWS, etc.) registered as a module before any container can be used. An empty collection means no provider module was added to the dependency graph.","triggerScenarios":"Any call path that resolves a blob container (IBlobContainer<T>.SaveAsync/GetAsync/etc.) when no IBlobProvider implementation is registered in the DI container. The selector queries IEnumerable<IBlobProvider> and finds zero entries.","commonSituations":"Forgetting to add the provider module (e.g., Volo.Abp.BlobStoring.FileSystem.FileSystemBlobStoringModule) to DependsOn; adding the package but not the module attribute; misconfiguring the module so the provider never registers; building a test host without a provider.","solutions":["Add the desired provider module to your module's DependsOn attribute (e.g., [DependsOn(typeof(FileSystemBlobStoringModule))]).","Ensure the provider NuGet package is referenced by the project that declares the module.","For custom providers, register your IBlobProvider implementation in ConfigureServices.","Verify the module loads by checking the DI container can resolve IEnumerable<IBlobProvider> at startup."],"exampleFix":"// before: no provider module declared\n[DependsOn(typeof(AbpBlobStoringModule))]\npublic class MyAppModule : AbpModule { }\n\n// after: declare the file system provider module\n[DependsOn(typeof(AbpBlobStoringModule))]\n[DependsOn(typeof(FileSystemBlobStoringModule))]\npublic class MyAppModule : AbpModule\n{\n    public override void ConfigureServices(ServiceConfigurationContext context)\n    {\n        Configure<AbpBlobStoringFileSystemOptions>(x => x.BaseFolder = \"C:\\\\MyBlobs\");\n    }\n}","handlingStrategy":"validation","validationCode":"// At startup, assert at least one IBlobProvider is registered.\nvar providers = serviceProvider.GetServices<IBlobProvider>().ToArray();\nif (providers.Length == 0)\n{\n    throw new InvalidOperationException(\"No IBlobProvider registered. Add a provider module (e.g., FileSystemBlobStoringModule) to DependsOn.\");\n}","typeGuard":"public static bool HasAnyBlobProvider(IServiceProvider sp) =>\n    sp.GetServices<IBlobProvider>().Any();","tryCatchPattern":"try\n{\n    var provider = blobProviderSelector.Get(containerName);\n}\ncatch (AbpException ex) when (ex.Message.Contains(\"No BLOB Storage provider was registered\", StringComparison.Ordinal))\n{\n    logger.LogCritical(ex, \"Missing blob provider module; cannot use blob storing.\");\n    throw;\n}","preventionTips":["Always declare the provider module in DependsOn when adding AbpBlobStoringModule.","Add a startup check that IEnumerable<IBlobProvider> is non-empty.","In tests, register an in-memory or file-system provider in the test host.","Review module dependencies whenever splitting a solution across hosts."],"tags":["blob-storing","configuration","dependency-injection","startup"],"backgroundTag":null,"analyzedSha":"7ed43b1931b9df46a50c0c59148a18645641d0df","analyzedAt":"2026-08-13T16:26:11.351Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}