In the olden days the ASP.NET Core template had:
public Startup(IHostingEnvironment env)
{
var builder = new ConfigurationBuilder()
.SetBasePath(env.ContentRootPath)
.AddJsonFile("appsettings.json", optional: true, reloadOnChange: true)
.AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true)
.AddEnvironmentVariables();
Configuration = builder.Build();
}
which gave the application developer access to the reloadOnChange
flag.
In these modern days we have:
var builder = WebApplication.CreateBuilder(args);
which doesn't provide that access.
What is my simplest and/or least-code way to specify reloadOnChange
flag for appsettings.json
files?