I have generated a new web project. it seems that in .net core 3.1 the appSettings.jsons were generated and working fine. the problem is that they are loaded and controlled by the runtime and not me. So I cant invoke AddEnvironmentVariables
Where is the right place to call AddEnvironmentVariables
in such case?
public class Startup
{
public Startup(IConfiguration configuration)
{
Configuration = configuration;
}
}
public class Program
{
public static void Main(string[] args)
{
CreateHostBuilder(args).Build().Run();
}
public static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.UseStartup<Startup>();
});
}
AddEnvironmentVariables
– Forgotten