ConfigurationManager 缓存刷新

服务没有停止的情况下,如果修改了配置,如果不刷新,是不会生效的,需要在每次重新读取配置前刷新配置文件,具体如下:

ConfigurationManager.RefreshSection("appSettings");

原文地址:https://www.cnblogs.com/Andy-Li/p/6273057.html