Skip to content
This repository has been archived by the owner on Dec 19, 2018. It is now read-only.

Commit

Permalink
Prepopulate the environment rather than fall back to it.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tratcher committed May 3, 2016
1 parent 7fdc927 commit e6bddd4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ public static void Initialize(this IHostingEnvironment hostingEnvironment, strin

hostingEnvironment.EnvironmentName =
options.Environment ??
Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT") ??
hostingEnvironment.EnvironmentName;
}
}
Expand Down
3 changes: 3 additions & 0 deletions src/Microsoft.AspNetCore.Hosting/WebHostBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ public WebHostBuilder()
_hostingEnvironment = new HostingEnvironment();
_configureServicesDelegates = new List<Action<IServiceCollection>>();
_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>
Expand Down

0 comments on commit e6bddd4

Please sign in to comment.