Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DOTNET_ENV is not set when environment name is defined from source code #61

Closed
MrDave1999 opened this issue Mar 24, 2022 · 0 comments · Fixed by #65
Closed

DOTNET_ENV is not set when environment name is defined from source code #61

MrDave1999 opened this issue Mar 24, 2022 · 0 comments · Fixed by #65
Labels
bug Something isn't working
Milestone

Comments

@MrDave1999
Copy link
Owner

Example:

new EnvLoader()
     .SetEnvironmentName("test")
     .LoadEnv();

System.Console.WriteLine(Env.IsTest()); // output: False (should be True)

The LoavEnv method does not set the DOTNET_ENV variable and for that reason the output is False instead of True, since the Env class methods access the DOTNET_ENV variable.

Another example:

new EnvLoader().LoadEnv();
System.Console.WriteLine(Env.Development()); // output: False (should be True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
1 participant