最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Reloading Options with reloadOnChange in ASP.NET Core 6 and higher - Stack Overflow

programmeradmin2浏览0评论

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?

发布评论

评论列表(0)

  1. 暂无评论