A .NET library to load environment variables from .env files. Supports .NET Core and .NET Framework
Available on NuGet
Visual Studio:
PM> Install-Package DotNetEnv
.NET Core CLI:
dotnet add package DotNetEnv
Will automatically look for a .env
file in the current directory
DotNetEnv.Env.Load();
You can also specify the path to the .env
file
DotNetEnv.Env.Load("./path/to/.env");
The variables in the .env
can then be accessed through the System.Environment
class
System.Environment.GetEnvironmentVariable("IP")
If you have found a bug or if you have a feature request, please report them at this repository issues section.
This project is licensed under the MIT license. See the LICENSE file for more info.