Possible Duplicate:
How to print the current Stack Trace in .NET without any exception?
When an exception is thrown, its text contains the stack trace. Can I somehow obtain the stack trace text(including file and line) without exceptions?
public void f() { //blah string stacktrace = ???; //blah }
Environment.StackTrace or System.Diagnostics.StackTrace if you need a more convienient (i.e. not string) representation
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