Why aren’t my environment variables being set in Visual Studio 2026?
Summary A set of environment variables defined in Visual Studio 2026’s launchSettings.json were not visible to test code executed under NUnit, causing Environment.GetEnvironmentVariable(“MY_VARIABLE”) to always return an empty string. The root issue is that NUnit tests do not run under the Visual Studio debug profile, so the environment variables defined there are never applied. Root … Read more