asp.net - Does .NET Framework 4.8 support .env files for configuration? - Stack Overflow

admin2025-04-18  6

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?

转载请注明原文地址:http://www.anycun.com/QandA/1744936273a89721.html