For those who wonders why debugging time out occurs in Visual Studio, and how to solve the timeout problem, this post is for them.
It was kind of irritating to see the debugging process killed automatically when debugging a web site/application in Visual Studio hosted in IIS 7, after installing Windows 7 in my PC. I wonder why that used to happen because it did never happen in case of Asp.net web site/application hosted in IIS 6.0. In first few days, I used to try to complete my debugging works in a hurry (Say, within 30-40 seconds), but, I couldn't continue this for long, and hence, decided to explore this issue a bit. Well, as it turned out, this was a matter of changing some settings in the corresponding Application pool in IIS.
Take a look at the following screen shot. This has been taken by Right clicking on the Application pool of an Asp.net web site/application and selecting "Advaced Settings":
Figure : Ping Enable property of Application pool in IIS
There is a health monitoring system in IIS (Enabled if the property "Ping Enabled=true" for the corresponding Application pool), which pings the Asp.net worker process periodically, to make sure that the process is responsive, healthy and alive. Now, when the Ping Enabled value is set to "true" (Which is by default), the debugging timeout occurs occurs in Visual Studio while debugging an Asp.net web site or application. The reason is, while debugging, the process is simply halted at the break point, and hence, it cannot response back to the health monitoring system's ping.
Now, when the health monitoring system doesn't get any response from the worker process, it immediately doesn't kill the process. It waits for the period of time specified in seconds (By the Application pool's property "Ping Maximum Response Time In Seconds") and then kills the worker process. Hence, the debugging process gets killed in Visual Studio.
So, to solve the debuggin timeout issue, either of the following two approaches could be followed:
Disable health monitoring
The easiest solution is to disable health monitoring by setting the value "Ping Enabled"=false. This would prevent the situation from happening which leads to kill the debugging process when it is unable to give any response from the health monitoring ping. This allows to be able to debug and wait at a break point for an infinite amount of time without any problem.
However, the pay off is, the health monitoring process is no longer enabled, and hence, there is no way for the administrator to get notified about any possible issues which could lead to make the web site/application down or perform sluggishly. Fortunately, in your development PC, this is probably not needed at all, and hence, disabling health monitoring could be an easy solution for you.
Increase Maximum Response Time
As said already, while debugging, when the worker process gives no response to the health monitoring ping, it waits for a certain amount of time and then kills the debugging process (Worker process). So, another approach could be to increase the waiting time long enough (Say, 600 seconds or 10 minutes) to be able to debug a particular problem. A good thing with this approach is, the health monitoring process is still enabled, and, you can adjust the waiting time as much as you need, which is handy.