I use the following code to get the StackFrame in case of an error:
System.Diagnostics.StackTrace stackTrace = new System.Diagnostics.StackTrace(true);
System.Diagnostics.StackFrame stackFrame = stackTrace.GetFrame(stackFrameIndex);
Now my problem is that I don’t get line number or filename information. The stackFrame contains something like this:
stackFrame {GetSetting at offset 288 in file:line:column **<filename unknown>:0:0**}
Even when debugging. How can I get that information?
If you wrote some code for SP that has to reside in the GAC, you need to put the PDBs in %systemroot%\symbols\dll. Then, you should get better debug information.