How to get the line number of an exception?

  • Thread starter Thread starter Rotsey
  • Start date Start date
R

Rotsey

Hi,

Am trying to be able to the line number of an exception.

The stack trace is not showing it.

rotsey
 
Is that available *always*? I thought linenumber-info was only available
when there is a .pdb file present for the dll where the error is? (Read:
when it has been compiled in DEBUG mode.)

Line number is available in DEBUG only
 
Even with the /debug:pdbonly option ? I tried yestarday, it creates the PDB
file while I'm still considered in release mode but it doesn't seem to
actually use those PDB files when an exception occurs...
 
I tested this and you guys are right only in DEBUG does give line numbers.

So that I means I have deploy in DEBUG if i want to be able to debiug any
problems.

What is the performance hit in DEBUG mode, any ideas???
 
Hi Patrice,

Sorry for the lack of reply,

My tests conclude with line numbers for both /debug:full and
/debug:pdbonly, but the /debug[+|-] will override line numbers

csc /debug:full /debug- test.cs

Will not display line numbers, though nor will it create a pdb file

you may also try just

csc /debug+ test.cs

Which should display line numbers.

If you still get no line numbers, try to compile your code on another
system. If that works, I would reinstall .net framework.
 
Back
Top