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
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.
Comments
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