Can you modify the web.config and NOT restart the

2019-01-25 16:53发布

4条回答
甜甜的少女心
2楼-- · 2019-01-25 17:26

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

查看更多
等我变得足够好
3楼-- · 2019-01-25 17:38

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

查看更多
Evening l夕情丶
4楼-- · 2019-01-25 17:48

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.

查看更多
The star\"
5楼-- · 2019-01-25 17:50

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.

查看更多
登录 后发表回答