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

Obtaining Run Time error line number

P: n/a
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
Share this Question
Share on Google+
10 Replies


P: n/a
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

P: n/a
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

P: n/a
* "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

P: n/a
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

P: n/a
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

P: n/a
* <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

P: n/a
* "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

P: n/a
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

P: n/a
* "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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.