asp.net - 调试请求超时 (System.Web.HttpException)

标签 asp.net debugging timeout visual-studio-debugging

根据MSDN关于 system.web httpRuntime executionTimeout:

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 似乎都允许无限时间,所以我从不捕获要调试的异常!

最佳答案

如果您能够在本地生成长时间运行的执行,只需转到“调试”菜单,然后选择“全部中断”。然后您可以使用 Debug -> Windows -> Threads View 查看所有事件线程。您可能能够确定需要这么长时间的原因。

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

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

最后,您可以尝试反射性地更改 RequestTimeoutManager 类的行为,该类定期调用 TimeoutIfNeeded(DateTime now)。但是,我无法轻易地看到一种方法来改变它以使用 debug=false 的行为。

关于asp.net - 调试请求超时 (System.Web.HttpException),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9468158/

相关文章:

c# - ReportViewer - 如何呈现超过 65,000 行的 Excel 文件?

c# - 将一组值发送到 Oracle 过程以在 WHERE IN 子句中使用

javascript - 在 Chrome 的 Javascript 调试器中前进 N 次

visual-studio - 如何摆脱调试输出 "symbol loaded"

Linux coreutils超时相对时间还是绝对时间?

Javascript 检查页面上所有 <span> 标签 ID

asp.net - 错误: SelectedValue which is invalid because it does not exist in the list of items

.net - 设置程序集以进行调试

c# - 如何在 XDocument.Load(string uri) 上设置超时?

javascript - 强调 throttle +确保最后一次通话