I know that to get environment variables with .NET Core the library to use theoretically is the System.Environment with the method GetEnvironmentVariable("environmentVariableKeyHere"). However, on Linux (Ubuntu 18.04) this isn't picking up my user based environment variables. I set the variables export THEVARIABLE="THEVALUE"
and the .NET Core lib library and method won't pick it up. I even used the GetEnvironmentVariables() method and reviewed the entire list that it does pick up. None of the user environment variables where/are in that list.
I run a simle echo $THEVARIABLE
in the terminal via bash and boom, the variable is there. The value is returned as expected, but still nothing via the .NET Program. Speaking of which, the repo is right here > https://github.com/Adron/InteroperabilityBlackBox if you'd like to check it out. It's built with Rider + .NET Core 2.1 and includes a library (is that an issue when running and trying to get user environment variables?), console app, and test library.