How to get stack trace of a running process from within a Visual Studio add-in?
- by Jack
I am writing a Visual Studio add-in in C# which will run while I am debugging a process in the same Visual Studio window and I need access to that the process' stack trace from within my add-in. I tried putting this code into my add-in but it returns the add-in's stack trace, not the process I am debugging.
System.Diagnostics.StackTrace stacktrace = new System.Diagnostics.StackTrace(true);
System.Diagnostics.StackFrame stackframe = stacktrace.GetFrame(0);
Any help would be appreciated.