Debugging a debug request (System.Web.HttpException)

According to MSDN regarding system.web httpRuntime executeTimeout:

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. 

This is a great feature for most debugging, as it allows the request to stay alive during debugging. What if I want to debug a timeout error? No matter what timeout properties I set anywhere in .NET, it probably allows unlimited time, so I will never catch an exception for debugging with!

+4
source share
1 answer

If you can run long runs locally, just go to the Debug menu and select "Break all". Then you can use the Debug -> Windows -> Threads view to view all of your active threads. You can probably determine what takes so long.

Alternatively, you can set Debug = false; then attach Visual Studio to your process and set it to break down into the ThreadAbortExceptions instances that have been selected.

Alternatively, you can set DebugDiag to capture the dump file when a long execution is detected. You can use WinDbg (hard) or Visual Studio 2010 and higher to load these dump files and verify the health of your program.

Finally, you can try to reflect the behavior of the RequestTimeoutManager class, which periodically calls TimeoutIfNeeded (DateTime now). However, I cannot trivially see a way to change this to use the debug = false behavior.

0
source

Source: https://habr.com/ru/post/1398633/


All Articles