Awfully hacked, but without runtime hooks (I don't know anything) is the only way to get to the stack frame from which you throw ....
All exceptions that are known to be output from the terminal should have the following in their constructor:
#if DEBUG System.Diagnostics.Debugger.Launch() #endif
This will be a dialog that allows the user to either provide the appropriate debugger or select “no”, and there will be no debugging (in any case, the exception will end and then be thrown. This, obviously, works only on exceptions whose source you control.
I do not recommend this, in the debug assembly with the debugger attached, you can simply choose to get a "first chance", an exception break, which should usually be sufficient for your needs.
Another option is to start programming mini-dumps programmatically on exception sites, such data can then be checked later with a tool like windbg, but do not interfere too much with the desired exception behavior that unwinds the stack after.
The act of exclusion falling into your catch-all trap is exactly the stack that you don't need, sorry. If you like C ++ and you like it, you can create a small (but difficult to get right) mono fork, because of which all exceptions trigger the debugger. Or simply rebuild the BCL Exception monoclass to do the same as described above.
ShuggyCoUk
source share