iis 7.5 Application web.config restarts entire application pool
In IIS 7.5开发者_JS百科 I have the following configuration:
Sites
-Site1
--App1
--App2
Site1, App1 and App2 are each running in separate Application Pools. When I update the web.config under App1 it restarts both App1 and App2. Is there anyway to prevent a web.config update in a sub app from restarting the entire site?
When a change is made to a web.config, it is typically the app domain that is unloaded and not the app pool that is recycled (some info on that here). Site1, App1, and App2 should each be defined as separate applications and not just virtual directories. Each application will be running in its own app domain, so replacing or changing a web.config should not affect the others unless it is a child application that is inheriting settings from the parent web.config. Depending on the change, making a change to the Site1 web.config could end up causing the app domain for App1 and App2 to unload.
If App1 and App2 are using the same web.config (i.e. if both document roots are pointing to the same file system location) then making a change to the web.config will end up unloading the app domain for both applications.
You can change the App Pool behavior so that a config file change does not cause an app pool recycle.
App Pools -> Your App Pool -> Advanced Settings -> Recycling/Disable Recycling for Configuration Changes = True
(default value is False)
精彩评论