Why is it that exceptions thrown in C# include a functional stack trace, but not line numbers? I spent way too much time today tracking down an exception in one of our web-based tools that would have been terribly simple if only I had line numbers...
|
|
|||||
Comments
Re: Exceptional
by
Parveen
on Fri 23 Feb 2007 03:26 AM CST | Permanent Link
I don't have the deepest understanding of the CLI runtime, but here a few issues I can see.
The runtime is language-agnostic. So you would have to make it work at the CLI level in a language-agnostic manner. You may not have source for some parts of the callstack. There are an absurd number of transitions going from source to executable. Code generation can happen at build-time, link-time, install-time, load-time, and runtime during hotspot analysis. Re: Re: Exceptional
by
Tom
on Fri 23 Feb 2007 04:49 PM CST | Permanent Link
But on the flipside any exceptions on an aspx page or debug time exceptions come with line numbers, so at some level it is possible.
Re: Exceptional
by
Ian
on Sun 25 Feb 2007 09:32 PM CST | Permanent Link
To show line numbers in the stack trace, the code has to be compiled with that feature enabled.
Unfortunately, I can't recall offhand what the necessary compiler settings are (perhaps "debug" or "stacktrace"?). There's a list of compiler options: http://msdn2.microsoft.com/en-us/library/6ds95cz0(VS.80).aspx Re: Re: Exceptional
by
Anonymous
on Thu 06 Sep 2007 02:23 PM CDT | Permanent Link
Here is an article that discusses how to get line number for an exception stack trace.
http://dnchannel.blogspot.com/2007/09/getting-line-numbers-in-exception-stack.html |
|||||