From e5201268572b284123286c9f85fd79cc09c77e1a Mon Sep 17 00:00:00 2001 From: Shady Nagy Date: Fri, 31 Jul 2020 18:05:37 +0200 Subject: [PATCH] Docker working without Configure ConfigureAppConfiguration (#443) * Docker working without Configure ConfigureAppConfiguration. * Sort modifiers --- src/PublicApi/Program.cs | 9 +-------- src/Web/Program.cs | 9 +-------- 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/src/PublicApi/Program.cs b/src/PublicApi/Program.cs index 86d753766..8ea315337 100644 --- a/src/PublicApi/Program.cs +++ b/src/PublicApi/Program.cs @@ -13,7 +13,7 @@ namespace Microsoft.eShopWeb.PublicApi { public class Program { - public async static Task Main(string[] args) + public static async Task Main(string[] args) { var host = CreateHostBuilder(args) .Build(); @@ -44,13 +44,6 @@ public async static Task Main(string[] args) public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args) - .ConfigureAppConfiguration((builderContext, config) => - { - var env = builderContext.HostingEnvironment; - config - .AddJsonFile("appsettings.json") - .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true, reloadOnChange: true); - }) .ConfigureWebHostDefaults(webBuilder => { webBuilder.UseStartup(); diff --git a/src/Web/Program.cs b/src/Web/Program.cs index c310bbe97..15bdea548 100644 --- a/src/Web/Program.cs +++ b/src/Web/Program.cs @@ -43,14 +43,7 @@ public static async Task Main(string[] args) public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args) - .ConfigureAppConfiguration((builderContext, config) => - { - var env = builderContext.HostingEnvironment; - config - .AddJsonFile("appsettings.json") - .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true, reloadOnChange: true); - }) - .ConfigureWebHostDefaults(webBuilder => + .ConfigureWebHostDefaults(webBuilder => { webBuilder.UseStartup(); });