1

To improve application error handling I would like to log exceptions stack traces and variables values of each stack level. I've searched for Reflection but couldn't find anything. How can I see the variables?

2 Answers 2

3

Without using additional tools (such as creating memory dump, or using profiling API) you can't do it. While you can use LocalVariableInfo class to list local variables, in order to display the values, you'd need to do it explicitly.

Sign up to request clarification or add additional context in comments.

Comments

2

System.Environment.StackTrace property should write the Stack trace of the current managed stack. To get the variables, refer to Get list of local objects/variables during runtime

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.