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

The loader does not search for the .env file in parent directories when the path is absolute #55

Closed
MrDave1999 opened this issue Mar 15, 2022 · 0 comments · Fixed by #56
Milestone

Comments

@MrDave1999
Copy link
Owner

MrDave1999 commented Mar 15, 2022

Example:

new EnvLoader()
       .AddEnvFile(Path.Combine(Directory.GetCurrentDirectory(), ".env")
       .Load();

I ran this code on Windows, so the absolute path of the .env file is:

C:\Users\syslan\Documents\Visual Studio 2022\DotEnv.Core\src\bin\Debug\netcoreapp3.1

It seems that when the Load method does not find the .env file in the absolute path, it does not search for the .env file in the parent directories, i.e. if the .env file is not in netcoreapp3.1, it does not search in the directories above netcoreapp3.1. The loader should search in the parent directories such as Debug, bin, src, etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant