From 9eb8591d65a9bcb405beaaf81d81fa4b06d4d3b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Mon, 12 Dec 2016 23:42:42 +0300 Subject: [PATCH] Make web app running. --- src/AbpDesk/AbpDesk.UI/AbpDeskWebAppModule.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/AbpDesk/AbpDesk.UI/AbpDeskWebAppModule.cs b/src/AbpDesk/AbpDesk.UI/AbpDeskWebAppModule.cs index 3dd74d181f..5ec2f8979a 100644 --- a/src/AbpDesk/AbpDesk.UI/AbpDeskWebAppModule.cs +++ b/src/AbpDesk/AbpDesk.UI/AbpDeskWebAppModule.cs @@ -22,7 +22,9 @@ namespace AbpDesk { public override void ConfigureServices(IServiceCollection services) { - var configuration = BuildConfiguration(); + var hostingEnvironment = services.GetSingletonInstance(); + + var configuration = BuildConfiguration(hostingEnvironment); services.Configure(configuration); @@ -63,10 +65,10 @@ namespace AbpDesk }); } - private static IConfigurationRoot BuildConfiguration() + private static IConfigurationRoot BuildConfiguration(IHostingEnvironment hostingEnvironment) { var builder = new ConfigurationBuilder() - .SetBasePath(Directory.GetCurrentDirectory()) //TODO: Get from IHostingEnvironment!!! + .SetBasePath(hostingEnvironment.ContentRootPath) .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true); var configuration = builder.Build();