IIS7.5 - prevent recycling when changing default document

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.


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.