When asp.net throws an exception, the exception object includes a stack trace property, but it's one big long string. Is there a way to get it as an array or some other structure that can be examined programmatically?
My immediate problem is that I've got a bug that shows up in an admin function now and then. It's hard to reproduce, so I wanted to say that when it happens, I catch the exception and search the stack for the lowest level statement that is within my code and display it, rather than dumping the whole stack. Okay, maybe this is more trouble than it's worth and I should just dump the stack, find and fix the bug, and then rip out the stack dump. But now I'm curious if it's possible.
RE duplicate: No, that's not my question. I'm not asking how to get a stack trace without throwing an exception. I'm asking, given that I have caught an exception, can I get the stack trace as an array or some other structure rather than as a string blob.