Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does debugging keep timing out in IIS7?

When I am debugging on my Windows 7 IIS7 machine, I get this error during a debug:

The web server process that was being debugged has been terminated by IIS. this can be avoided by configuring application pool setting in IIS. see help for further details.

What am I doing wrong?

like image 379
mrblah Avatar asked Sep 14 '09 13:09

mrblah


People also ask

How do I debug IIS application pool?

To start debugging, select IIS Express (<Browser name>) or Local IIS (<Browser name>) in the toolbar, select Start Debugging from the Debug menu, or press F5. The debugger pauses at the breakpoints. If the debugger can't hit the breakpoints, see Troubleshoot debugging.

How do I enable remote debugging in IIS?

Select Configure remote debugging to configure the firewall and start the remote debugger. When configuration is complete, the Remote Debugger window appears. The remote debugger is now waiting for a connection. Use the server name and port number shown to set the remote connection configuration in Visual Studio.

How do I debug IIS hosted site in Visual Studio?

We can easily debug any web application that is hosted on IIS by attaching worker process of that application to Visual Studio as shown below. From Visual Studio IDE > Tools > Attach to Process Select the particular Process, then start debugging. Now, enjoy debugging with Visual Studio.


2 Answers

When you are debugging, IIS will not service any other requests until you are done stepping through your code. That includes the "ping" request that IIS sends to itself. Since IIS doesn't hear back from itself, it decides to shut itself down, which promptly terminates your debugging.

The solution is to increase the Ping Maximum Response Time in the application pool settings from its default value of 90 seconds. Set it to something high enough that will give you enough time to debug your code (like maybe 300 seconds).

Microsoft has a long-winded write-up here.


Edit: Others have suggested setting "Ping Enabled" to false. There are several reasons why I prefer to keep it in place, just with a larger interval, but the most important is that you will (most likely) have worker processing pinging enabled on production, and you should strive to develop and debug under a configuration that is as close to production as possible. If you do NOT have ping enabled on production, then by all means disable it locally as well.

like image 175
Portman Avatar answered Nov 15 '22 22:11

Portman


http://weblogs.asp.net/soever/archive/2009/06/18/debugging-sharepoint-asp-net-code-smart-key-codes-disable-timeout.aspx

Your App Pool -> Advanced Settings -> Ping Enabled to False

like image 22
Ana Betts Avatar answered Nov 15 '22 22:11

Ana Betts