Debugger unable to Dump exceptions
Does anyone else have problems with the LINQPad 5 debugger failing to Dump exceptions?
Debugger error: Cannot abort FuncEval: DumpContrived example for a 404 error, C# expressions mode, break when exceptions are unhandled:
new WebClient().DownloadString("http://www.linqpad.net/GetFile.aspx?LINQPad6Setup.exe")
---------------------------
LINQPad Debugger Dump
---------------------------
Dumping this object requires all threads to run.
Unfreeze all threads?
---------------------------
Yes No
---------------------------
Comments
EDIT: also just verified on v5.22.02 as well
Dumping some exceptions works fine like
1/int.Parse("0")
, maybe it is WebException specific?(In case you're interested in the mechanics: The operation is executed via a "func-eval". Func-evals are essential in writing a debugger, but they also create a minefield. Here's some background: https://blogs.msdn.microsoft.com/jmstall/2006/03/05/what-does-a-debugger-author-need-to-do-to-support-func-eval/ and https://blogs.msdn.microsoft.com/jmstall/2005/03/23/func-eval-is-evil/ ).
After trying your sample, I can successfully dump the WebException, which means I can't identity the cause without extra info. Can you try a couple of things:
1. Run the same thing in VS. Does the debugger freeze for a while, or give an error?
2. Click the minus sign on above the Dump. If you change the dump depth from 3 to 1, does it work? And if so, the output should contain hyperlinks that you can click. Does clicking any particular hyperlink cause an error? Sometimes particular property accessors are problematic and I can tell LINQPad to avoid calling them.
1. VS 2013 doesn't freeze with the same code, but it seems to also only have a depth of 2 in the Exception's "View Detail" form, and won't let me drill down further.
2. I am getting some very sporadic results, which I don't really understand. I think, if I get an exception from the func-eval and restart the query, I quite often end up with more problems, so I've taken to restarting LINQPad each time to be sure.
It does indeed work when changing the dump depth to 1.
Depth 2 also seems to work like depth 1, so it's something at depth 3 that causes it.
But, at any depth, if I try to dump the exception again (i.e. a second time), quite often it fails. LINQPad handles it gracefully, though - after a long delay, I see a "Debugger dump timed out." message box, after which I can dump it again multiple times successfully.
Most hyperlinks work fine, but at quite often items under the TargetSite (especially "DeclaringType", even though "ReflectedType", which has exactly the same value from what I can see, will work fine) causes a "Debugger error: Cannot abort FuncEval: RunUserAction" and/or the text where I clicked the hyperlink is stuck at "Executing..." until I complete the query by pressing Execute again, whereby the output appears to contain the expanded dump.
Would that indicate that my .NET installation is at fault, taking too long to lookup types sometimes?