34

Finally broke down and seeking help, my client/iis (not sure which) usually times out after about 30s - 1 minute while im debugging (stepping through code) which not only causes me to lose my spot and have to start over (usually stepping faster, making more mistakes) but the IIS Debug session closes completely and I have to warm up the entire session again.

What's the best way to get more time out of a debugging session?

Debugging a vanilla 3.5 Web Site (not app) on IIS 7.5 Classic Pipeline

Aren
  • 54,668
  • 9
  • 68
  • 101
  • I don't know if this helps or not but in my experience, I have only had this issue with Web Sites and not Web Applications. For MANY reasons, I try to avoid Web Sites like the plague. – Jaxidian Apr 29 '10 at 23:41
  • Really have no choice, this is me trying to maintain an existing site while we build the new WebAPP to replace it with. – Aren Apr 29 '10 at 23:42
  • How are you debugging? Windbg or Visual studio remote debugging? In extreme cases, I use windbg and attach to the process. This way I still have the state. – Raj Kaimal Apr 29 '10 at 23:42
  • I've seen this in MVC 1 apps in vs 2008. VS 2010 doesn't seem to have the same problem. – Joel Apr 29 '10 at 23:43
  • It's a forms app, not MVC, It's Visual Studio Remote Debugging attaching to my local IIS 7.5 worker process. – Aren Apr 29 '10 at 23:55
  • For those who came in this answer, and are using ASP NET CORE, see: https://stackoverflow.com/questions/3829202/iis-request-timeout-on-long-asp-net-operation/44634489#44634489 – Edmundo Santos Jun 19 '17 at 15:31

3 Answers3

38

Setting the connection limit works if you set it high enough. I wanted to never be bothered by this again. Here is what I did:

This assumes you've got an IIS App Pool selected in the IIS Manager

...In the Advanced Settings dialog box, locate the Process Model section, and perform one of the following actions:

  1. Set Ping Enabled to False.
  2. Set Ping Maximum Response Time to a value that is larger than 90 seconds.

Setting Ping Enabled to False stops IIS from checking whether the worker process is still running and keeps the worker process alive until you stop your debugged process. Setting Ping Maximum Response Time to a large value allows IIS to continue monitoring the worker process.

Nick DeVore
  • 9,748
  • 3
  • 39
  • 41
  • It's worth noting that setting the Response Time to something large is "enough" to fix the problem, Ping Enabled will help. Marking this as accepted because it's more correct than the other one. – Aren Mar 05 '13 at 22:36
  • I suppose I should change my wording from "...did not work for me." to "...did not work the way I wanted it to by never bothering me again." – Nick DeVore Mar 05 '13 at 23:27
  • I just change the Application Pool of my Website to its default (DefaultAppPool) and its works. :) Thanks. – pampi Dec 12 '16 at 00:07
5

Rather than changing your app pool settings in IIS, you should temporarily change the httpRuntime executionTimeout attribute in the web.config. The default is 110 seconds, which is usually plenty of time, but not if you are debugging. Increasing the timeout will allow requests to the server to run for longer.

<system.web>
   <httpRuntime executionTimeout="360" />
</system.web>

That sets it to 6 minutes (360 seconds).

After you are done debugging you can remove the attribute and IIS will go back to the default.

grahamesd
  • 4,773
  • 1
  • 27
  • 27
  • I did this. I set it to 9999, which is about 2.7 hours. Yet, after a few mins of debugging, my web page displayed "Internet Explorer cannot display the webpage " while i was debug stepping through the server code. Is there a separate browser timeout for IE that can be changed? – Chad Nov 30 '18 at 20:08
  • @ChadD I've never personally debugged a production web app. I have either been able to replicate the bug in a QA environment or used the IIS or error logs to figure out what the problem is. I highly recomment you use such a method. Debugging production directly is asking for trouble.. To answer your question:The execution timeout should work. If you are getting a message that IE can't display the page, then it may be something other than a timeout.. – grahamesd Dec 01 '18 at 00:51
3

Note that if you are using a ScriptManager (for say, update panels), it uses it's own timeout set by:

<asp:ScriptManager ID="ScriptManager1" AsyncPostBackTimeout="???" ...
</asp:ScriptManager>

I recommend that you set it to a high value only when in debugging. You can do this in the pageload event of the page where the scriptmanager control exists:

If Debugger.IsAttached Then
    ScriptManager1.AsyncPostBackTimeout = 600
End If
Alex
  • 1,353
  • 3
  • 20
  • 31