0

I am using JetBrains Rider and attempting to set environment variables for an integration test project I have. In my launchsettings.json I have it set but in code when I use Environment.GetEnvironmentVariable("COSMOSDB_KEY") it returns null.

{
    "$schema": "http://json.schemastore.org/launchsettings.json",
    "profiles": {
        "FooBar.IntegrationTests": {
            "commandName": "Project",
            "environmentVariables": {
                "COSMOSDB_KEY": "SUPERMAN",
                "foo": "bar"
            }
        }
    }
}

When running the test I am selecting FooBar.IntegrationTests under the profile. Am I missing something here?

Dr Schizo
  • 4,045
  • 7
  • 38
  • 77
  • If you try to restart will it be solved?You can try to refer to the [link](https://github.com/dotnet/runtime/issues/28367). – Yiyi You Oct 06 '22 at 07:34

1 Answers1

1

The following solution worked for me. Sharing in case found helpful for other devs

my *.http directory structure

- Requests
    - Breakfast
        - CreateBreakfast.http
  1. I right clicked on Requests folder
  2. Click "Tools -> Start Index"

After that, I was able to see my environment: enter image description here

Ram Fattah
  • 349
  • 2
  • 11