Reputation: 8605
How can I get programmatic access to the call stack?
Upvotes: 12
Views: 3042
Reputation: 42516
The right way is to use the StackTrace
and StackFrame
classes. Throwing an exception just to get the stack trace is completely misusing exceptions.
Upvotes: 1
Reputation: 3012
You can use the StackTrace
and StrackFrame
classes in System.Diagnostics
.
Upvotes: 6