ConfigurationManager.AppSettings Caching

前端 未结 6 2199
北恋
北恋 2020-12-29 20:13

We know that IIS caches ConfigurationManager.AppSettings so it reads the disk only once until the web.config is changed. This is done for performance purposes.

Someo

6条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2020-12-29 20:30

    Try it,

    ConfigurationManager.RefreshSection("appSettings")

    Just be careful file name (in bin folder)

    Normal file name : appname.exe.config

    if debug mode : appname.vshost.exe.Config

提交回复
热议问题