restart website in IIS when changing values in the appSettings of the web.config

回眸只為那壹抹淺笑 提交于 2019-12-24 02:09:45

问题


Just to be safe, when I make changes in the values of the appSettings in the Web.config I always restart the WebSite so all the changes can be refreshed. But do I really need to restart it? how is IIS handling the appSetting values, is it reading the values in one time (once you start the application) or is IIS reading it every time a client is accessing the website?


回答1:


Actually, it is not the "Website" but the "App Pool" that needs the restart. Remember the website pipeline in IIS has no "executable" code, just markup.

This is however treated as a "Per App Pool" setting by IIS. In your INETMGR, open the properties of any app pool and look for this setting: "Disable Recycling for Configuration Changes" (under the Recycling group of settings). If you set this to "True", then IIS will not monitor for config changes FOR THAT APP POOL's CONFIG FILES and will not restart the app pools if you edit/change something. However, that means you must manually recycle --- a valid scenario if you are updating the website and want to change the BIN folder and multiple .config files in the hierarchy. Left on its own, in the minimum condition of one web.config file, that's two app pool restarts.. one for the BIN changes and one for web.config.



来源:https://stackoverflow.com/questions/23589684/restart-website-in-iis-when-changing-values-in-the-appsettings-of-the-web-config

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!