title: How to set ASPNETCORE_ENVIRONMENT when testing .NET Core 2.0 class library with xUnit in VS2017
body: <p>I use this code to load settings depending on Environment in my <strong>xUnit test project</strong>:</p>
  
  <pre><code>public class TestSettings
  {
      public string AzureConnectionString { get; }
  
      public TestSettings(ITestOutputHelper output)
      {
          string envVariable = Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT");
  
          output.WriteLine($"env: '{envVariable}'");
  
          IConfigurationRoot config = new ConfigurationBuilder()
              .AddJsonFile("appsettings.json")
              .AddJsonFile($"appsettings.{envVariable}.json", optional: true)
              .Build();
          AzureConnectionString = config.GetConnectionString("AzureStorage");
      }
  }
  </code></pre>
  
  <p>But whatever I do I get <code>envVariable</code> empty. Where can I set <code>ASPNETCORE_ENVIRONMENT</code> for test project (VS2017)?</p>
  
  <p><strong>To ASP.NET Core Tooling Team</strong></p>
  
  <p>Please make test project settings work for environment. Thank you.</p>