4

Is there any setting in IIS 7.5 to prevent it from recycling the app pool when a default document is changed?

IIRC this didn't happen in IIS 6 and I want that behavior back.

2 Answers 2

4

This is caused by delegated configuration. In IIS7+, the settings can be written to web.config (and they do by default). Touching web.config causes an appdomain recycle.

You have a couple solutions. One is to turn of delegated configuration, but that comes with considerations, like ensuring that you don't already have settings in your web.config files, which will cause the sites to break.

Another option is to use Configuration Editor or a text editor to apply your settings to applicationHost.config instead of web.config.

To see further information you can watch week 17 of my video series on IIS.

4
  • Scott, Could he use "disallowRotationOnConfigChange" on the appPool? Sep 29, 2011 at 21:02
  • 3
    Chris, that's a good question. disallowRotationOnConfigChange is for app pool settings only and not for web.config, so an appdomain recycle still occurs even if disallowRotationOnConfigChange is applied. There is a File Change Notification (FCN) registry change that can prevent web.config changes from causing an appdomain recycle, but then the changes themselves won't be picked up either until the app pool is manually recycled, so I don't believe that would be the solution for this situation. Sep 30, 2011 at 13:33
  • Got it! Thanks, and keep up the video series!... Just watched week 37 last night ;-) Sep 30, 2011 at 14:04
  • Thanks Chris! I always appreciate encouraging feedback like that. Sep 30, 2011 at 19:00
4

Actually, you can prevent recycling in a number of ways:

  • Set HKLM\SOFTWARE\Wow6432Node\Microsoft\ASP.NET\FCNMode to DWORD value 1 (system wide).
  • Use <httpRuntime fcnMode="Disabled"/> in your web.config (ASP.NET 4.5+)
  • Set "Disable Recycling for Configuration" to True (per AppPool)
  • Set numRecompilesBeforeAppRestart to a high value in web.config (only way I know of that works at least to some extend on ASP.NET 1.0 and 1.1).

More details on each option in my answer on StackOverflow here.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .