Can you modify the web.config and NOT restart the ASP.NET application? [duplicate]

主宰稳场 提交于 2019-11-28 01:07:20

问题


Possible Duplicate:
How to prevent an ASP.NET application restarting when the web.config is modified?

Was just thinking about uptime. Thanks.


回答1:


Yes, you can; see this answer.

However, it is not a good idea.
Until ASP.Net restarts the AppDomain, it will not look at web.config.
If you change web.config, your changes will have no effect until the AppDomain is restarted.




回答2:


You can create an external settings file and then reference it in your web.config. You will need to change the attribute "restartOnExternalChanges" to false in your machine.config file.

See: http://msdn.microsoft.com/en-us/library/ms228057.aspx




回答3:


You can setup a duplicate IIS container on a different ip address / hostname. Make your modification to the new version and then swap the ip's over. It gets rid of the compile time of the application restart. However, if you rely on in-proc session it'll all go wrong for any current users anyway.

Safest option is to allow it to restart and just pick a good time to do it. You can also set compilation batch = false. This can also speed up the compile time in critical systems.




回答4:


The application pool will reset when you modify the wed.config and you will lose any session information stored on the server.



来源:https://stackoverflow.com/questions/2155123/can-you-modify-the-web-config-and-not-restart-the-asp-net-application

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