Starts in:
1 DAY
12 HRS
5 MIN
36 SEC
Starts in:
1 D
12 H
5 M
36 S

Activities of "trina.thompson"

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.

Showing 11 to 15 of 15 entries
Made with ❤️ on ABP v9.1.0-preview. Updated on November 20, 2024, 13:06