473,398 Members | 2,335 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Line number in a release version

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
4 1185
>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
"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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: dtsearch | last post by:
Press Contact: Belinda Banks S&S Public Relations (212) 946-2823 Belinda@sspr.com Announcing New dtSearch® Product Line Version Release Enhances Indexing, Searching and Display of MS Word,...
0
by: dtsearch | last post by:
Announcing dtSearch® Product Line Release With New Terabyte Indexer New Version Can Index Over a Terabyte of Text in a Single Index, With Indexed Search Time Typically Under a Second BETHESDA,...
65
by: Skybuck Flying | last post by:
Hi, I needed a method to determine if a point was on a line segment in 2D. So I googled for some help and so far I have evaluated two methods. The first method was only a formula, the second...
11
by: Ken Varn | last post by:
I want to be able to determine my current line, file, and function in my C# application. I know that C++ has the __LINE__, __FUNCTION__, and __FILE___ macros for getting this, but I cannot find a...
6
by: Phil Jollans | last post by:
Hi, I have an error dialog which shows the stack trace, usually without line numbers in the release version. To try to diagnose a particular problem, I have provided a user with a debug version...
1
by: tascienu | last post by:
When I am debuging on my local machine, and an exception occurs, I quickly find the line number. when I deploy the project, I switch to Release. But when an exception occurs, I don't get the line...
1
by: pukya78 | last post by:
Hi, I am trying to get the current file and the line number which is getting executed. I used: MessageBox.Show(New StackTrace(New StackFrame(True)).GetFrame(0).GetFileLineNumber) which gives me...
2
by: John | last post by:
Hi For error logging purpose, is it possible to get from the vb system feature the SUB name and the line number? Thanks Regards
4
by: Jeff Jarrell | last post by:
I have a block of code that during development is prone to casting errors. It is mostly a DataReader type thing. It looks something like this. _prtPNID = myDLReader.GetString("prtPNID")...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.