How to get the line number of an exception?

R

Rotsey

Hi,

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

The stack trace is not showing it.

rotsey
 
M

Morten Wennevik

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
 
P

Patrice

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...
 
R

Rotsey

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???
 
M

Morten Wennevik

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,444
Messages
2,571,709
Members
48,796
Latest member
Greg L.
Top