62,243
社区成员




IConfiguration config = new ConfigurationBuilder()
.AddJsonFile(path, false, true)
.Build();
return new ServiceCollection()
.AddOptions()
.Configure<ClientConfig>(config)
.BuildServiceProvider()
.GetService<IOptions<ClientConfig>>()
.Value;
这个是例子,在core里面默认支持是否监控文件变化,AddJsonFile的第三个参数设置为true就是监控,然后再通过options模式读取出来时就自动更新了
http://www.cnblogs.com/artech/p/inside-asp-net-core-1.html