skip to Main Content

How to read environment variables in .NET 6? – Asp.net

in my .NET Core 3.1 WebApi project I'm reading environment variable as the very first thing and loading appsettings.json according to it: public static IHostBuilder CreateHostBuilder(string[] args) { string environment = Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT"); ... } But I didn't find out how…

VIEW QUESTION
Back To Top
Search