I have one .net core web api project which is not abp solution but I want to use the blob storing module with this project. I have created one module in the project as below.
[DependsOn(typeof(NxPBlobStoringAwsModule))]
public class NxPAipModule : AbpModule
{
public override void PreConfigureServices(ServiceConfigurationContext context)
{
//context.Services.AddAutoMapperObjectMapper<>();
base.PreConfigureServices(context);
Configure<AbpBlobStoringOptions>(options =>
{
options.Containers.Configure<DocumentBlobContainer>(container =>
{
container.UseAws(Aws =>
{
Aws.Region = "eu-west-2";
Aws.CreateContainerIfNotExists = true;
Aws.UseClientSideEncryption = false;
Aws.AccessKeyId = "";
Aws.SecretAccessKey= "";
Aws.ContainerName = "nxp-staging-1";
});
});
});
}
}
and create the intance of NxPApiModule in program.cs file as below.
using (var application = AbpApplicationFactory.Create<ChurchAipModule>(options =>
{
options.UseAutofac();
}))
This is my NxPBlobStoringAwsModule
[DependsOn(typeof(AbpBlobStoringModule),
typeof(AbpCachingModule),
typeof(AbpAutofacModule))]
public class NxPBlobStoringAwsModule : AbpModule
{
}
When I run the project, I am getting below exception on application build.
- Exception message and full stack trace: System.AggregateException: 'Some services are not able to be constructed (Error while validating the service descriptor 'ServiceType: Volo.Abp.BlobStoring.IBlobContainer Lifetime: Transient ImplementationType: Volo.Abp.BlobStoring.BlobContainer
1[Church.Api.DocumentBlobContainer]': Unable to resolve service for type 'Volo.Abp.BlobStoring.IBlobContainerFactory' while attempting to activate 'Volo.Abp.BlobStoring.BlobContainer
1[Church.Api.DocumentBlobContainer]'.) (Error while validating the service descriptor 'ServiceType: Church.Api.Services.IShipmentAppService Lifetime: Transient ImplementationType: Church.Api.Services.ShipmentAppService': - Steps to reproduce the issue:
10 Answer(s)
-
0
To use the ABP Blob Storing module (such as AWS S3) in a non-ABP .NET Core Web API project, you must ensure that all required dependencies and module registrations are present. The error you are seeing indicates that the BlobStoring provider (e.g., AWS) is not fully registered, specifically the required services for IBlobContainerFactory.
In your custom module, you must add a dependency on the AWS Blob Storing provider module. For AWS, this is AbpBlobStoringAwsModule. You must also install the NuGet package Volo.Abp.BlobStoring.Aws and add the module dependency:
[DependsOn(typeof(AbpBlobStoringAwsModule))] public class NxPBlobStoringAwsModule : AbpModule { }
- In your main module (e.g., NxPAipModule), ensure you also depend on your custom AWS module:
[DependsOn(typeof(NxPBlobStoringAwsModule))] public class NxPAipModule : AbpModule { public override void PreConfigureServices(ServiceConfigurationContext context) { Configure<AbpBlobStoringOptions>(options => { options.Containers.Configure<DocumentBlobContainer>(container => { container.UseAws(aws => { aws.Region = "eu-west-2"; aws.CreateContainerIfNotExists = true; aws.UseClientSideEncryption = false; aws.AccessKeyId = ""; aws.SecretAccessKey = ""; aws.ContainerName = "nxp-staging-1"; }); }); }); } }
Most importantly, you must ensure that the AWS Blob Storing provider module is initialized by the ABP module system. If you only register your own modules, but not the official provider module, the required services (like IBlobContainerFactory) will not be available, resulting in the error you see.
In your Program.cs, when creating the application, make sure you use your main module (NxPAipModule) and that all dependencies are resolved:
using (var application = AbpApplicationFactory.Create<NxPAipModule>(options => { options.UseAutofac(); })) { application.Initialize(); // ... your code }
Double-check that you have installed the following NuGet packages:
- Volo.Abp.BlobStoring.Aws
- Volo.Abp.BlobStoring
- Volo.Abp.Autofac
If you still encounter issues, ensure that your DocumentBlobContainer class is defined as:
using Volo.Abp.BlobStoring; [BlobContainerName("document-blob-container")] public class DocumentBlobContainer { }
- The key point is that the provider module (AbpBlobStoringAwsModule) must be included in the dependency chain and initialized by the ABP module system.
Sources:
- ABP Blob Storing AWS Provider Documentation
- ABP Blob Storing System
- ABP Support: File Management Module and Azure Blob Storage
This response was generated by AI. If it didn’t solve your problem, feel free to post a new answer — our support team will jump in to help you soon.
-
0
I am getting following error now.
System.AggregateException: 'Some services are not able to be constructed (Error while validating the service descriptor 'ServiceType: Church.Api.Services.IShipmentAppService Lifetime: Transient ImplementationType: Church.Api.Services.ShipmentAppService': Unable to resolve service for type 'AutoMapper.IMapper' while attempting to activate 'Church.Api.Services.ShipmentAppService'.)
I have added dependency of auto mapper.
[DependsOn(typeof(NxPBlobStoringAwsModule), typeof(AbpAutoMapperModule))] public class ChurchAipModule : AbpModule {
-
0
hi
Can you share a simple project?
liming.ma@volosoft.com
I will check and fix it
Thanks.
-
0
I sent email
-
0
hi
I didn't receive. Can you send it by https://wetransfer.com/
Thanks.
-
0
I sent it by wetransfer.
-
0
Thanks, I will check it asap.
-
0
hi
What is your email?
I have changed your project to an abp modular app.
Thanks.
-
0
imran@spacestem.com
-
0
hi
Sent by https://wetransfer.com/