473,396 Members | 2,033 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,396 software developers and data experts.

Obtaining Run Time error line number

Al
Hi,

I am seeking to obtain the line number of an error once
deployed with out inserting line numbers in the method.
The IDE inserts line numbers but this function does not
appear to be a deployment option. Without entering a line
number eg.(10210:) in the code erl and e.tostring do not
indicate the line on which the error occured. Inserting
line numbers appeares to insert no-ops into the code when
it is stepped through in the IDE. Is there something I
am missing on this or do I need to insert line numbers
for run time reporting like VB6

Thanks
Al
Nov 20 '05 #1
10 5229
Use the Debug.writeline method to give you runtime information. This will
print in the output window of the debugger.
Debug.Writeline("I'm printout out a statement now")
OHM

Al wrote:
Hi,

I am seeking to obtain the line number of an error once
deployed with out inserting line numbers in the method.
The IDE inserts line numbers but this function does not
appear to be a deployment option. Without entering a line
number eg.(10210:) in the code erl and e.tostring do not
indicate the line on which the error occured. Inserting
line numbers appeares to insert no-ops into the code when
it is stepped through in the IDE. Is there something I
am missing on this or do I need to insert line numbers
for run time reporting like VB6

Thanks
Al

Nov 20 '05 #2
Hi,

My concern is once the product is deployed thus the
IDE/Debugger is not in use. I do not want to insert
anything into the code manualy but would still like to
get line numbers :)

Al

-----Original Message-----
Use the Debug.writeline method to give you runtime information. This willprint in the output window of the debugger.
Debug.Writeline("I'm printout out a statement now")
OHM

Al wrote:
Hi,

I am seeking to obtain the line number of an error once
deployed with out inserting line numbers in the method.
The IDE inserts line numbers but this function does not
appear to be a deployment option. Without entering a line number eg.(10210:) in the code erl and e.tostring do not indicate the line on which the error occured. Inserting
line numbers appeares to insert no-ops into the code when it is stepped through in the IDE. Is there something I
am missing on this or do I need to insert line numbers
for run time reporting like VB6

Thanks
Al

.

Nov 20 '05 #3
* "Al" <an*******@discussions.microsoft.com> scripsit:
I am seeking to obtain the line number of an error once
deployed with out inserting line numbers in the method.
The IDE inserts line numbers but this function does not
appear to be a deployment option. Without entering a line
number eg.(10210:) in the code erl and e.tostring do not
indicate the line on which the error occured. Inserting
line numbers appeares to insert no-ops into the code when
it is stepped through in the IDE. Is there something I
am missing on this or do I need to insert line numbers
for run time reporting like VB6


See (complete thread):

<http://groups.google.com/groups?selm=u7POIgjfDHA.3616%40TK2MSFTNGP11.phx.gb l>

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>
Nov 20 '05 #4
Hi Al,

Line numbers are only available in .NET 1.1 and also only when compiled
for debug. Would you be happy deploying a debug version?

Regards,
Fergus
Nov 20 '05 #5
Write the errors to a log file then

OHM

an*******@discussions.microsoft.com wrote:
Hi,

My concern is once the product is deployed thus the
IDE/Debugger is not in use. I do not want to insert
anything into the code manualy but would still like to
get line numbers :)

Al

-----Original Message-----
Use the Debug.writeline method to give you runtime information.
This will print in the output window of the debugger.
Debug.Writeline("I'm printout out a statement now")
OHM

Al wrote:
Hi,

I am seeking to obtain the line number of an error once
deployed with out inserting line numbers in the method.
The IDE inserts line numbers but this function does not
appear to be a deployment option. Without entering a line
number eg.(10210:) in the code erl and e.tostring do not
indicate the line on which the error occured. Inserting
line numbers appeares to insert no-ops into the code when
it is stepped through in the IDE. Is there something I
am missing on this or do I need to insert line numbers
for run time reporting like VB6

Thanks
Al

.

Nov 20 '05 #6
* <an*******@discussions.microsoft.com> scripsit:
My concern is once the product is deployed thus the
IDE/Debugger is not in use. I do not want to insert
anything into the code manualy but would still like to
get line numbers :)


Then you'll have to insert the line numbers before compiling. Maybe you
can write an add-in to automate that, but IMO that's not a goof idea
because it will reduce performance.

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>
Nov 20 '05 #7
* "Fergus Cooney" <fi****@post.com> scripsit:
Line numbers are only available in .NET 1.1


Where did you read that?!

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>
Nov 20 '05 #8
Yeah, true but I thought this was for debugging purposes ?

OHM.

One Handed Man wrote:
Write the errors to a log file then

OHM

an*******@discussions.microsoft.com wrote:
Hi,

My concern is once the product is deployed thus the
IDE/Debugger is not in use. I do not want to insert
anything into the code manualy but would still like to
get line numbers :)

Al

-----Original Message-----
Use the Debug.writeline method to give you runtime information.
This will print in the output window of the debugger.
Debug.Writeline("I'm printout out a statement now")
OHM

Al wrote:
Hi,

I am seeking to obtain the line number of an error once
deployed with out inserting line numbers in the method.
The IDE inserts line numbers but this function does not
appear to be a deployment option. Without entering a line
number eg.(10210:) in the code erl and e.tostring do not
indicate the line on which the error occured. Inserting
line numbers appeares to insert no-ops into the code when
it is stepped through in the IDE. Is there something I
am missing on this or do I need to insert line numbers
for run time reporting like VB6

Thanks
Al
.

Nov 20 '05 #9
* "One Handed Man" <Bo****@Duck.net> scripsit:
Yeah, true but I thought this was for debugging purposes ?


I think it should be part of an error reporting system with the release
version of the application. Getting the line numbers with the
'StackTrace' won't work in an application that is compiled in Release
mode, so I wouldn't use it in a distribution. Maybe it's better to add
custom error handling code or line numbers by hand on critical places in
the sourcecode.

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>
Nov 20 '05 #10
Agreed !

OHM
Herfried K. Wagner [MVP] wrote:
* "One Handed Man" <Bo****@Duck.net> scripsit:
Yeah, true but I thought this was for debugging purposes ?


I think it should be part of an error reporting system with the
release version of the application. Getting the line numbers with the
'StackTrace' won't work in an application that is compiled in Release
mode, so I wouldn't use it in a distribution. Maybe it's better to
add custom error handling code or line numbers by hand on critical
places in the sourcecode.

Nov 20 '05 #11

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Kim Haines | last post by:
I need help finding where an error is occuring in my code. I use a try-catch block like this in my global.asa: try { //my code } catch (e) { Application('errormsg') = ("An exception...
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...
3
by: Paul | last post by:
I am using a try-catch-finally statement. In my Catch clause, I trap an error and display the error with the .Message property of the Exception class. The problem is that I do not know which...
3
by: Rotsey | last post by:
Hi, I am trying to write some error handling code to log the error. But getting the line number of the error is not simple. Is it because the app is set to "Release" and does not have debug...
3
by: aljamala | last post by:
Hi, I have a page that whenever an error occur, I send an email to support with the error description, script name, server, referer, etc... However, I want to add the line number to the email...
3
by: DontB3 | last post by:
Hi, I'm new in this forum, and i hope someone can help. I'm creating an automatic application that transfer a database from Access -> DBF -> Oracle. When My App try to execute Insert SQL...
11
by: Bryan Crouse | last post by:
I am looking a way to do error checking on a string at compile time, and if the string isn't the correct length have then have the compiler throw an error. I am working an embedded software that...
4
by: Ravi, Dallas, Texas | last post by:
http://www.netnewsgroups.net/group/microsoft.public.dotnet.framework.aspnet/topic22503.aspx shows ways to get errors in a server context. i am trying to find ways to trap the line number where...
10
by: Adam Tippelt | last post by:
Hi, This one has been bugging me for a while, and I can't find a solution to get round it. The error message is: Run-time error '3022': The changes you requested to the table were not...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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...

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.