Prepopulate the environment rather than fall back to it.
This commit is contained in:
parent
7fdc9271f4
commit
e6bddd4131
|
|
@ -63,7 +63,6 @@ namespace Microsoft.AspNetCore.Hosting.Internal
|
||||||
|
|
||||||
hostingEnvironment.EnvironmentName =
|
hostingEnvironment.EnvironmentName =
|
||||||
options.Environment ??
|
options.Environment ??
|
||||||
Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT") ??
|
|
||||||
hostingEnvironment.EnvironmentName;
|
hostingEnvironment.EnvironmentName;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -45,6 +45,9 @@ namespace Microsoft.AspNetCore.Hosting
|
||||||
_hostingEnvironment = new HostingEnvironment();
|
_hostingEnvironment = new HostingEnvironment();
|
||||||
_configureServicesDelegates = new List<Action<IServiceCollection>>();
|
_configureServicesDelegates = new List<Action<IServiceCollection>>();
|
||||||
_configureLoggingDelegates = new List<Action<ILoggerFactory>>();
|
_configureLoggingDelegates = new List<Action<ILoggerFactory>>();
|
||||||
|
|
||||||
|
// This may end up storing null, but that's indistinguishable from not adding it.
|
||||||
|
UseSetting(WebHostDefaults.EnvironmentKey, Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT"));
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue