An Exception object has a StackTrace property on it. But it is just a string.
Is there a way to get an actual System.Diagnostics.StackTrace object from an Exception?
I ask because I am getting the Exception object from an UnhandledExceptionEventHandler and I don't have access to the frame that generated the exception to get an actual Stack Trace.
try{
//some code
}
catch (Exception ex){
System.Diagnostics.StackTrace stackTrace = new System.Diagnostics.StackTrace(ex);
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With