0

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#?

Greg Finzer
  • 6,714
  • 21
  • 80
  • 125
  • 1
    *"it is blank because code spaces is not using windows"* - that's a pretty big leap in attribution of causality. Of all the computing concepts, environment variables are one of the most uniform across platforms. If Codespaces is *actually* setting an environment variable, that code will work. Maybe the repository wasn't granted access? – madreflection Jan 03 '23 at 15:42
  • The repository was granted access prior to trying the code above. – Greg Finzer Jan 03 '23 at 18:08

0 Answers0