Read environment variables in ASP.NET Core
<p>Running my ASP.NET Core application using <a href="https://stackoverflow.com/questions/30374725/is-net-execution-environment-dnx-similar-to-mono">DNX</a>, I was able to set environment variables from the command line and then run it like this:</p>

<pre><code>set ASPNET_ENV = Production
dnx web
</code></pre>

<p>Using the same approach in 1.0:</p>

<pre><code>set ASPNETCORE_ENVIRONMENT = Production
dotnet run
</code></pre>

<p>does not work - the application does not seem to be able to read environment variables.</p>

<pre><code>Console.WriteLine(Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT"));
</code></pre>

<p>returns null</p>

<p>What am I missing?</p>