Is it possible to get the full line number of StackTrace WITH at any given point in the code
I found this:
var stackTrace = new StackTrace();
This gives me the full stack I am executing from. But it does not include line numbers.
I also found this:
var stackTrace = new StackTrace(new StackFrame(1, true));
This gives me line numbers, but for only one frame of StackTrace (not a complete StackTrace).
Is there a way to get both together?
NOTE. I have no exception I'm working with. I'm just at the code point where I want to register the stack trace in my own way.
NOTE. I know about Environment.Properties.StackTrace. But this returns a string, not a StackTrace object.
source share