2012-02-27 108 views
4

按照MSDN有关的System.Web的httpRuntime executionTimeout:调试请求超时(System.Web.HttpException)

This time-out applies only if the debug attribute in the compilation element is 
False. Therefore, if the debug attribute is True, you do not have to set this 
attribute to a large value in order to avoid application shutdown while you are 
debugging. 

这对于大多数调试一个伟大的功能,因为它能够在调试过程中活路请求。如果我想通过本身调试超时错误怎么办?无论我在任何地方设置了什么超时属性,.NET似乎都允许无限的时间,所以我从来没有捕捉到异常来调试!

回答

0

如果您能够在本地生成长时间运行的执行,只需转到调试菜单,然后选择“全部中断”。然后,您可以使用Debug - > Windows - > Threads视图查看所有活动线程。你可能会确定需要花费很长时间。

或者,您可以设置您的Debug = false;然后将Visual Studio附加到您的进程中,并将其设置为在抛出正在抛出的ThreadAbortExceptions实例时中断。

或者,您可以在检测到长时间运行的执行时将DebugDiag设置为capture a dump file。您可以使用WinDbg(艰难)或Visual Studio 2010及更高版本来加载这些转储文件并检查程序的运行状态。

最后,您可以尝试反思性地更改RequestTimeoutManager类的行为,该类定期调用TimeoutIfNeeded(现在是DateTime)。然而,我不能平凡地看到一种方法来改变这种使用debug = false的行为。