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();