During a debugging session on my Windows 7 machine, which was interrupted by a phone call, I received the following error:

The process that was being debugged has been terminated by Internet Information Services (IIS). This can be avoided by configuring Application Pool ping settings in IIS. See help for further details.

Why was the worker process terminated ?

When you attach the debugger to the worker process and stop on a breakpoint, all execution of code in the worker process is stopped. However, this also means that the worker process won't be able to respond to ping requests done by IIS.

IIS is pinging the worker process in your app pool in order to monitor its health; to make sure it's working fine and responding to requests.

So when IIS receives no response on a ping within a given timeframe, it assumes that the worker process has stopped responding and in turn shuts down the worker process.

This feature is turned on in IIS by default. 

The following options control the ping behavior:

  • pingingEnabled
    Specifies whether pinging is enabled for the worker process.
    The default value is true.
  • pingInterval
    Specifies the time between health-monitoring pings that the WWW service sends to a worker process.
    The default value is 00:00:30 (30 seconds).
  • pingResponseTime
    Specifies the time that a worker process is given to respond to a health-monitoring ping. After the time limit is exceeded, the WWW service terminates the worker process.
    The default value is 00:01:30 (1 minute 30 seconds).

There a simple solution in order to disable this on a development machine:

  • Open the settings of your application pool in the IIS configuration manager

    Application Pool configuration

  • Either set "Ping Enabled" to false or increase "Ping Maximum Response Time" to something higher than 90 seconds and you won't run into this problem while debugging.

More informationen:

Error: Web site worker process has been terminated by IIS
http://msdn.microsoft.com/en-us/library/bb763108.aspx

Enable Worker Process Pinging for an Application Pool (IIS 7)
http://technet.microsoft.com/en-us/library/cc725836(WS.10).aspx

Process Model Settings for an Application Pool
http://www.iis.net/ConfigReference/system.applicationHost/applicationPools/add/processModel