How do I get an Environment Variable in C# that was set in GitHub Codespaces?

356 Views Asked by At

I am using .NET Core 7.

I have set an environment variable in Github Codespaces using the settings secret: https://github.com/settings/codespaces

When I try to get it out using C# it is blank because code spaces is not using windows:

string result = Environment.GetEnvironmentVariable("GOLD");

How do I get the secret in C#?

0

There are 0 best solutions below