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.

Mauricio Scheffer
  • 831
  • 2
  • 10
  • 23

2 Answers2

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.

Scott Forsyth
  • 16,449
  • 3
  • 37
  • 56
  • Scott, Could he use "disallowRotationOnConfigChange" on the appPool? – Chris Anton Sep 29 '11 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. – Scott Forsyth Sep 30 '11 at 13:33
  • Got it! Thanks, and keep up the video series!... Just watched week 37 last night ;-) – Chris Anton Sep 30 '11 at 14:04
  • Thanks Chris! I always appreciate encouraging feedback like that. – Scott Forsyth Sep 30 '11 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.

Abel
  • 1,037
  • 8
  • 20
  • 32