
```
namespace Core.Extensions{
///
/// 读取配置文件
///
public class ConfigServices
{ public static IConfiguration Configuration { get; set; }
static ConfigServices()
{
//ReloadOnChange = true 当appsettings.json被修改时重新加载
Configuration = new ConfigurationBuilder().Add(new JsonConfigurationSource { Path = "appsettings.json", ReloadOnChange = true }) .Build();
}
}}
```
网友评论