Fix environment variable loading in hosting #470

This commit is contained in:
Pavel Krymets 2015-11-10 12:12:06 -08:00
parent 660f1cad10
commit b2edb0d484
1 changed files with 3 additions and 0 deletions

View File

@ -80,8 +80,11 @@ namespace Microsoft.AspNet.Hosting
internal static IConfiguration LoadHostingConfiguration(string configJsonPath, string[] args)
{
// We are adding all environment variables first and then adding the ASPNET_ ones
// with the prefix removed to unify with the command line and config file formats
return new ConfigurationBuilder()
.AddJsonFile(configJsonPath, optional: true)
.AddEnvironmentVariables()
.AddEnvironmentVariables(prefix: EnvironmentVariablesPrefix)
.AddCommandLine(args)
.Build();