Step by step: Avoid being shutting down the process while debugging dynamics CRM plugins

Last week I wrote about how to remote debug Dynamics CRM plug-ins and workflow activities. In the case of plug-ins, remember that they run under the w3wp.exe IIS process and it’s not odd that while debugging (if IIS 7) you may experience the following annoying error:

Error

‘The web server process that was being debugged has been terminated by Internet Information Services. This can be avoided by configuring Application Pool ping settings in IIS’

image

The issue happens with IIS 7,  once you are in debug mode for more than 90 seconds (default time out value)

Cause

IIS 7 has a ‘ping’ mechanism which uses pulling to measure the health of the process. This ping, by default, is triggered every 30 secs and keeps waiting on a response for 90 secs. If ping doesn’t respond, the process is shut down automatically.

What happens is that while we are debugging, the application (CRM Server in this case) is unavailable to respond to any other requests.

Hence, no ping response is returned, terminating the process and generating our frustration because we couldn’t complete our debug session.

Solution

First of all, a thought I would like to share with you: believe me that it’s worth your time spending a couple of minutes following the next steps in order to get rid of this problem Smile

The good news also is that the solution and the steps involved are pretty simple. Here they are:

  • Open Internet Information Services (IIS) Manager.
  • On the left menu, expand the server and click on  Application Pools.
  • Select the application pool your Dynamics CRM Server is running on and click on ‘Advanced Settings…

image

  • Go to Process Model section where we can find the ping options. Despite we are able to control the ping response times and periods, I strongly suggest that for development purposes you set Ping Enabled = False.

image

..so,..change Ping Enabled from True to False.

image

This way, as name suggests, IIS will not trigger ping request and hence, we will never be shut down again while debugging from our Visual Studio.

  • Just click OK to save changes.
  • Honestly I don’t remember if I had to reset IIS (iisreset) to make this change take effect but anyway, if you are still being shut down, I recommend you make an iisreset. Also, I would double check the setting was applied for the right application pool Smile with tongue out

Hope this tip helps to save somebody else time,

PP



No Comments