abpframework/abp · error · AbpException

No BLOB Storage provider was used! At least one provider mus

Error message

No BLOB Storage provider was used! At least one provider must be configured to be able to use the BLOB Storing System.

What it means

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.

Source

Thrown at framework/src/Volo.Abp.BlobStoring/Volo/Abp/BlobStoring/DefaultBlobProviderSelector.cs:38

        ConfigurationProvider = configurationProvider;
        BlobProviders = blobProviders;
    }

    [NotNull]
    public virtual IBlobProvider Get([NotNull] string containerName)
    {
        Check.NotNull(containerName, nameof(containerName));

        var configuration = ConfigurationProvider.Get(containerName);

        if (!BlobProviders.Any())
        {
            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.");
        }

        if (configuration.ProviderType == null)
        {
            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.");
        }

        foreach (var provider in BlobProviders)
        {
            if (ProxyHelper.GetUnProxiedType(provider).IsAssignableTo(configuration.ProviderType))
            {
                return provider;
            }
        }

        throw new AbpException(
            $"Could not find the BLOB Storage provider with the type ({configuration.ProviderType.AssemblyQualifiedName}) configured for the container {containerName} and no default provider was set."
        );
    }
}

View on GitHub (pinned to 7ed43b1931)

Solutions

  1. Configure the container's provider via Configure<AbpBlobStoringOptions>(o => o.Containers.Configure<MyContainer>(c => c.UseFileSystemStorage())) or the typed extension.
  2. Set a default provider for all containers with o.Containers.ConfigureDefault(c => c.Use<ProviderType>()).
  3. Confirm the container name attribute matches the configuration key you are configuring.
  4. Ensure the Use* extension for your chosen provider is actually invoked at module configuration time.

Example fix

// before: container used without a provider type
Configure<AbpBlobStoringOptions>(options =>
{
    options.Containers.Configure<MyFileContainer>(c => { /* no Use* call */ });
});

// after: specify the provider for the container
Configure<AbpBlobStoringOptions>(options =>
{
    options.Containers.Configure<MyFileContainer>(c => c.UseFileSystemStorage());
});
Defensive patterns

Strategy: validation

Validate before calling

// Confirm the container has a ProviderType configured before first use.
var config = configurationProvider.Get(containerName);
if (config.ProviderType == null)
{
    throw new InvalidOperationException($"Container '{containerName}' has no ProviderType. Call a Use* extension (e.g., UseFileSystemStorage) or configure a default provider.");
}

Type guard

public static bool ContainerHasProviderType(BlobContainerConfiguration config) =>
    config.ProviderType is not null;

Try / catch

try
{
    provider = selector.Get(containerName);
}
catch (AbpException ex) when (ex.Message.Contains("No BLOB Storage provider was used", StringComparison.Ordinal))
{
    logger.LogError(ex, "Container {Name} lacks a provider configuration.", containerName);
    throw;
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of abpframework/abp@7ed43b1931 (2026-08-13). Data as JSON: /api/errors/a0675b2ac8251f3a. Report an issue: GitHub.