My code:
public static async Task Main(string[] args)
{
var host = new HostBuilder()
.ConfigureAppConfiguration(
(hostContext, configApp) =>
{
configApp.SetBasePath(Directory.GetCurrentDirectory());
configApp.AddJsonFile("appsettings.json");
configApp.AddJsonFile(
$"appsettings.{hostContext.HostingEnvironment.EnvironmentName}.json",
optional: true);
})
.Build();
await host.RunAsync();
}
In runtime I see that the value of HostingEnvironment.EnvironmentName
is Production
.
I tried to set the following environment variable in running configuration, but it didn't change the runtime: ASPNETCORE_ENVIRONMENT=Development
.
Where can I configure it?