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.
StackTrace
1.4m articles
1.4m replys
5 comments
57.0k users