ABP 7.0.1 Commercial / Blazor Server / EF / Separated Tenant and Host DBs / Non-tiered
Hi,
In order for developers to use local DBs without their local DB references being checked into source control, we attempted to use .NET's 'Manage User Secrets' feature for the DBMigrator project (secrets.json).
We are finding though that the framework still uses the connection string under the standard appsettings.json file for the DBMigrator project. When using the secrets.json feature under the Blazor project, everything works as expected. Is this by design or is there something we are missing with regards to the DBMigrator project?
Thanks in advance,
-Brian
3 Answer(s)
-
0
-
0
Hi @liangshiwei,
AddAppSettingsSecretsJson() is not a method of IConfigurationBuilder, so the change to DbContextFactory didn't work for us.
FYI - Instead, we got it to work by adding the following to the CreateHostBuilder method of Program.cs in the DbMigrator project.
.ConfigureAppConfiguration((hostContext, builder) => { if (hostContext.HostingEnvironment.IsDevelopment()) { builder.AddUserSecrets<Program>(); } })
-
0
Sorry I thought you were talking appsettings.secrets.json