I know it was possible to use:
System.Diagnostics.StackTrace t = new System.Diagnostics.StackTrace();
but that seems to not work anymore, as it needs an Exception-Object.
Try Environment.StackTrace. Just remember to be careful with what your logic afterwards is as stacks can change in unpredictable ways. Some discussion here: https://github.com/dotnet/corefx/issues/1420
2.1m questions
2.1m answers
60 comments
57.0k users