I am working on a .NET Framework 4.8 application and want to store configuration values in a .env file instead of using web.config, app.config, or appsettings.json.
- Does .NET Framework 4.8 support
.env files natively?
- If yes, how can I configure it to read values from a
.env file?
- If not, what alternatives can I use?
I tried using Environment.GetEnvironmentVariable("MY_VARIABLE"), but it only works if I manually set environment variables.
Is there any library or workaround that enables .NET Framework 4.8 to load environment variables from a .env file or can we store environment variables in IIS?