title: Get ASPNETCORE_ENVIRONMENT in core console app in container
body: <p>I've a ASP.NET core console application that I run in a container on Kubernetes. In the deployment.yaml I've set the environment variable:</p>
  
  <pre><code>env:
     - name: "ASPNETCORE_ENVIRONMENT"
       value: "Development"
  </code></pre>
  
  <p>And in the console application I've the following code:</p>
  
  <pre><code>static void Main(string[] args)
   {
              Console.WriteLine("Env: " + Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT"));
   }
  </code></pre>
  
  <p>But the ASPNETCORE_ENVIRONMENT is empty, how can I get to the configured environment variable? I use the same steps in a core webapi project and there I get the variable as follow:</p>
  
  <pre><code>public Startup(IHostingEnvironment env)
  {
       env.EnvironmentName
  }
  </code></pre>
  
  <p>This works in the core webapi but I don't have IHostingEnvironment in the console app.</p>