11

If I make a change to the file:

%windir%\system32\inetsrv\config\applicationHost.config

and update it with a change resulting in a valid config, will it cause IIS7 to restart and force restarts on all the apps?

I am trying this out with a hot-cloned vm of the server, but like to know if anyone has experience of either of these scenarios, what the expected outcome should be.

Many thanks

Kenny
  • 520
  • 1
  • 9
  • 24
  • 1
    Well, getting the format of the configuration file wrong does indeed break the server. – Kenny Mar 24 '11 at 16:40

2 Answers2

12

I put together a short video on this just last week. It covers the differences between AppDomains and AppPools and what causes recycles. I walk through various setting changes that cause full recycles and AppDomain recycles. I also cover how you can tell if a recycle occurs and what the impact is.

The short answer is that it depends. 'Touching' applicationHost.config by itself won't cause any level of recycle, but certain config changes will. Any change to .NET's machine.config or root web.config will cause an AppDomain recycle on the server for that framework version. Any change to a site's web.config will cause an AppDomain recycle for that site.

Scott Forsyth
  • 16,449
  • 3
  • 37
  • 56
3

If you edit App Pool properties, the App Pools should recycle (by default, unless disallowrotationonconfigchange is set, or its modern-day equivalent).

Otherwise, no, any system.webServer changes I can think of will not cause a restart of the app pools.

However, modifying web.config values may cause the apps to restart (the AppDomains) if you're using .Net.

See also: http://forums.asp.net/p/1344814/2742551.aspx

TristanK
  • 9,073
  • 2
  • 28
  • 39
  • +1 for a pretty much dead on answer. One comment is that touching web.config will *always* cause an app domain recycle. – Scott Forsyth Mar 25 '11 at 02:23
  • does this mean i could add a host header without triggering a restart? – mcintyre321 Sep 26 '12 at 23:42
  • @mcintyre321 Correct. A host header change won't cause an AppDomain recycle. – Scott Forsyth Nov 22 '13 at 04:45
  • 1
    Changing the global rewrite rules in applicationHost -> configuration -> rewrite seems to cause all the app pools to recycle though it's not clear why that would happen. For clarity, I haven't tested whether they are actually recycled or whether there is just a temporary interruption to their connection. Anyone know for sure? @ScottForsyth-MVP ? – Richard Hauer Oct 31 '15 at 09:33
  • 1
    @RichardHauer At some point URL Rewrite started causing appdomain recycles at the server level too. I noticed the shift a few years ago but I haven't track down when it switched. Originally that didn't occur with rule changes at the global level. So that is a bummer when it comes to making changes to global rewrite rules. They now do cause an app domain recycle on all sites. – Scott Forsyth Nov 18 '15 at 03:07
  • @ScottForsyth-MVP This is one of the reasons I have avoided the rules engine in favour of Helicon APE for such a long time... :( – Richard Hauer Nov 18 '15 at 14:28
  • It's too bad because URL Rewrite is so elegant and powerful. But you're right that the appdomain restart doesn't work well for frequent rule changes. – Scott Forsyth Nov 23 '15 at 06:17