I need to implement crash reporting framework on my C#(WPF) application, so i need full call stack,What would you guys suggest for doing this.
+2
A:
StackTrace st = new StackTrace(true);
for(int i =0; i< st.FrameCount; i++ )
{
// Note that high up the call stack, there is only
// one stack frame.
StackFrame sf = st.GetFrame(i);
Console.WriteLine();
Console.WriteLine("High up the call stack, Method: {0}",
sf.GetMethod());
Console.WriteLine("High up the call stack, Line Number: {0}",
sf.GetFileLineNumber());
}
ArsenMkrt
2009-12-16 07:14:12
Probably better to log in a file , instead of console .
NM
2009-12-16 07:29:27
I am just showing how to get stack trace Ankur, it is not real apllication
ArsenMkrt
2009-12-16 07:39:30