I was able to solve the issue by adding the below to my EntityFrameworkCoreTestModule:
new BlobStoringDbContext( new DbContextOptionsBuilder<BlobStoringDbContext>().UseSqlite(connection).Options ).GetService<IRelationalDatabaseCreator>().CreateTables();
in the CreateDatabaseAndGetConnection method.
DbMigrator is working without issue and is seeding data, including blob storage data, as expected.
The issue is only occurring when running the automated tests. I am specifically looking for guidance on working with blob storage from the test projects.
No BLOB Storage provider was registered! At least one provider must be registered to be able to use the BLOB Storing System.
Hi,
You need to configure a BLOB Storage provider: https://docs.abp.io/en/abp/latest/Blob-Storing#blob-storage-providers
It appears that it needs this configuration somewhere in tests in order to work. Where should that go?
No BLOB Storage provider was registered! At least one provider must be registered to be able to use the BLOB Storing System.
Hi,
You need to configure a BLOB Storage provider: https://docs.abp.io/en/abp/latest/Blob-Storing#blob-storage-providers
It is configured in the WebModule.
private void ConfigureBlobStorage(ServiceConfigurationContext context, IConfiguration configuration)
{
var env = context.Services.GetHostingEnvironment();
Configure<AbpBlobStoringOptions>(options =>
{
options.Containers.ConfigureDefault(container =>
{
//use database blob storage for development convenience, use Azure in production
if (env.IsDevelopment())
{
container.UseDatabase();
}
else
{
container.UseAzure(azure =>
{
azure.ConnectionString = configuration["AzureBlobProviderConfiguration:ConnectionString"];
azure.ContainerName = configuration["AzureBlobProviderConfiguration:ContainerName"] ?? "default";
azure.CreateContainerIfNotExists = bool.TryParse(configuration["AzureBlobProviderConfiguration:CreateContainerIfNotExists"], out bool createContainerIfNotExists) ? createContainerIfNotExists : true;
});
}
});
});
}
Thank you, that made it work.