diff --git a/src/Acme.BookStore.HttpApi.Host/Infrastructure/EnviromentLoader.cs b/src/Acme.BookStore.HttpApi.Host/Infrastructure/EnviromentLoader.cs index f8159be..dcd5297 100644 --- a/src/Acme.BookStore.HttpApi.Host/Infrastructure/EnviromentLoader.cs +++ b/src/Acme.BookStore.HttpApi.Host/Infrastructure/EnviromentLoader.cs @@ -16,9 +16,6 @@ public static class EnviromentLoader { public static async Task SetDatabaseEnviroment([NotNull] this WebApplicationBuilder builder) { - if (!builder.Environment.IsProduction()) - return; - var connectionSection = builder.Configuration.GetSection("ConnectionStrings"); var connections = connectionSection.GetChildren(); var sb = new StringBuilder(); diff --git a/src/Acme.BookStore.HttpApi.Host/Program.cs b/src/Acme.BookStore.HttpApi.Host/Program.cs index 8c3d88a..ae55fea 100644 --- a/src/Acme.BookStore.HttpApi.Host/Program.cs +++ b/src/Acme.BookStore.HttpApi.Host/Program.cs @@ -40,7 +40,9 @@ public class Program .WriteTo.Async(c => c.Console()) .WriteTo.Async(c => c.AbpStudio(services)); }); +#if RELEASE await builder.SetDatabaseEnviroment(); +#endif await builder.AddApplicationAsync(); var app = builder.Build(); await app.InitializeApplicationAsync();