I am trying to get the line number from a stack trace in my WP7 app. I have set debug info to full and am running the app in the Debug configuration, but there are no line numbers in stack traces. How can I fix this? I am aware of BugSense, but do not want to use it.
Share
Don’t think this is even possible, as
line numberrefers to the number of the line inside code-file, which has lost any relation with the binary after compilation. That’s why we usePDBfiles. They are “databases” for holding the relation between actually executed code and the final binary state of it.So don’t think there would be any possibility to get a
line numberat runtime.But if you have a
PDBfile of last compilation, you can potentially get that information fromStackFrame.GetFileLineNumber , which does: