title: Environment variables null in new Visual Studio 2019 but not Visual Studio 2017
body: <p>I downloaded and setup the newly released Visual Studio 2019 Professional and opened a solution I have been working on in Visual Studio 2017 Professional.</p>
  
  <p>This solution contains 3 ASP.NET Core projects and 1 docker-compose project.</p>
  
  <p>When starting debug session in 2019 I get a null reference exception on one line where I'm referring to my docker-compose environment variables. </p>
  
  <p>However if I open the same solution in Visual Studio 2017 I don't get this null reference exception as the values are correctly read from the docker-compose.yml file.</p>
  
  <p>I have looked over the setup of both versions of Visual Studio and don't appear to be missing anything.</p>
  
  <pre><code>// Create intance of item message handler
  var container = services.BuildServiceProvider();
  var _settings = container.GetService&lt;IOptions&lt;Settings&gt;&gt;().Value;
  
  var itemListenerSettings = _settings.RabbitSettings.ListenerSettings.FirstOrDefault(s =&gt; s.Key == "ItemListener");
  if (itemListenerSettings.Value != null)
  {
    // Register item listener...
  }
  </code></pre>
  
  <pre><code>version: '3.4'
  
  services:
    microserviceapi:
      image: microserviceapi
      container_name: ms
      build:
        context: ./MicroserviceApi
        dockerfile: Dockerfile
      environment:
        RabbitSettings:Hostname: "rabbit"
        RabbitSettings:Username: "user"
        RabbitSettings:Password: "pass"
        RabbitSettings:ReconnectionRetries: "10"
        RabbitSettings:ReconnectionTime: "1000"
        RabbitSettings:ListenerSettings__ItemListener__ExchangeName: "Imagine.ItemManagement"
        RabbitSettings:ListenerSettings__ItemListener__ExchangeType: "topic"
        RabbitSettings:ListenerSettings__ItemListener__QueueName: "foo.Item"
        RabbitSettings:ListenerSettings__ItemListener__RoutingKey: "item.*"
  </code></pre>
  
  <p>While running a debug session in Visual Studio 2019, calling <code>var _settings = container.GetService&lt;IOptions&lt;Settings&gt;&gt;().Value</code> I expect the property <code>RabbitSettings</code> of the variable <code>_settings</code> to contain the values from my docker-compose.yml file as it does in Visual Studio 2017.</p>