'How to Pull Docker Environment Variables from launchSettings.json in C#

I have a launchSettings.json file and some Docker environmentVariables. I attempted to pull one of the settings using GetEnvironmentVariable, and it doesn't seem to be working.

string strTest = Environment.GetEnvironmentVariable("TESTING");
Console.WriteLine($"Docker Env Test: {strTest}");

It isn't returning anything. I've searched around and the GetEnvironmentVariable seems to be the way to do it, but it's only returning variables from ProgC.

launchSettings.json

 {
  "profiles": {
    "ProgC": {
      "commandName": "Project",
      "environmentVariables": {
        "IsDev": "1",
        "JobName": "ProgC",
        "Environment": "TEST"
      }
    },
    "Docker": {
      "commandName": "Docker",
      "environmentVariables": {
        "IsDev": "1",
        "JobName": "ProgC",
        "AppID": "372011",
        "ConfigurationID": "1",
        "Environment": "TEST",
        "TESTING": " Yup"
      }
    }
  }
}


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source