By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,219 Members | 2,242 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,219 IT Pros & Developers. It's quick & easy.

Line number in a release version

P: n/a
Hello everyone,

Is there a way of detecting the line number of the error in a release version?

When I look at the stack it shows the file and the procedure, but not the
line number.

Thank you,
Daniel
Nov 21 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
>Is there a way of detecting the line number of the error in a release version?

Maybe if you compile with /debug:pdbonly and ship the debug symbols.
Not something I would recommend doing though.

Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Nov 21 '05 #2

P: n/a
"Mattias Sjögren" <ma********************@mvps.org> schrieb:
Is there a way of detecting the line number of the error in a release
version?


Maybe if you compile with /debug:pdbonly and ship the debug symbols.
Not something I would recommend doing though.


ACK. A sample can be found here:

<URL:http://dotnet.mvps.org/dotnet/code/codingtechnique/#LineNumberMethodName>

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #3

P: n/a
Thank you, that did it.

"Herfried K. Wagner [MVP]" wrote:
"Mattias Sjögren" <ma********************@mvps.org> schrieb:
Is there a way of detecting the line number of the error in a release
version?


Maybe if you compile with /debug:pdbonly and ship the debug symbols.
Not something I would recommend doing though.


ACK. A sample can be found here:

<URL:http://dotnet.mvps.org/dotnet/code/codingtechnique/#LineNumberMethodName>

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #4

P: n/a
Thanks,

You are right, I do not want to do this, but I found out that
Enviroment.StackTrace displays the line numbers even in the release version.

Daniel

"Mattias Sjögren" wrote:
Is there a way of detecting the line number of the error in a release version?


Maybe if you compile with /debug:pdbonly and ship the debug symbols.
Not something I would recommend doing though.

Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.

Nov 21 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.