Looking for a way to programmatically dump the call stack and a .net Win Forms app when ever a section of code is hit. Its something I haven't come across before but will save me some debug time.
Update: Forgot to add, how much overhead would this add to the application , i.e. would it slow it down considerably.
System.Environment.StackTrace
Will give you the current stack as a string.
You can also use the StackTrace
class as others have pointed out if you have more advanced needs.
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