473,498 Members | 1,074 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

missing line number in exceptions

In certain applications I have (vb.net 2003), when I
catch an exception and print the toString (or
stacktrace), it does NOT show the line number. However,
other simple apps I have it does show the line number.
How can I get it to always show the line number. How/why
is it not always showing it? Anyway, this is what the
exception shows (from one of the apps where exception
isn't working correctly):

System.DivideByZeroException: Attempted to divide by zero.
at eCCBOAUnifiedDesktopPrototype.frmMain.btnExTest_Cl ick
(Object sender, EventArgs e)

This is what it SHOULD be showing (from on of the simple
apps that it does work in):

System.DivideByZeroException: Attempted to divide by zero.
at TestExcep1.Form1.btnExTest_Click(Object sender,
EventArgs e) in c:\prog\vsnet\KillMeSoon\TestExcept1
\Form1.vb:line 62

Anyway, exception stacktraces are not nearly as useful
without the line number.

Thanks for any info anyway may have on this, as I have
not been able to fine ANY reference to this issue.

Tony

Nov 20 '05 #1
1 2699
In article <02****************************@phx.gbl>, Tony wrote:
In certain applications I have (vb.net 2003), when I
catch an exception and print the toString (or
stacktrace), it does NOT show the line number. However,
other simple apps I have it does show the line number.
How can I get it to always show the line number. How/why
is it not always showing it? Anyway, this is what the
exception shows (from one of the apps where exception
isn't working correctly):

System.DivideByZeroException: Attempted to divide by zero.
at eCCBOAUnifiedDesktopPrototype.frmMain.btnExTest_Cl ick
(Object sender, EventArgs e)

This is what it SHOULD be showing (from on of the simple
apps that it does work in):

System.DivideByZeroException: Attempted to divide by zero.
at TestExcep1.Form1.btnExTest_Click(Object sender,
EventArgs e) in c:\prog\vsnet\KillMeSoon\TestExcept1
\Form1.vb:line 62

Anyway, exception stacktraces are not nearly as useful
without the line number.

Thanks for any info anyway may have on this, as I have
not been able to fine ANY reference to this issue.

Tony


It depends on the build type. If you build the app in debug mode, then
you will get line numbers. If you build it in release mode, then you
will not since that information is removed from the executable.

--
Tom Shelton
MVP [Visual Basic]
Nov 20 '05 #2

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

Similar topics

2
2104
by: Hugh Macdonald | last post by:
I'm writing a tool at the moment that reads in an external file (which can use any Python syntax) At the moment, I'm reading the file in using: scriptLines = open(baseRippleScript).read()...
4
3013
by: Psibur | last post by:
Hello, trying to get back into c and was having issue with reading a simple text file with an aribtrary # of lines with 3 int's per line, with the eventual purpose of putting each int into an...
11
21883
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...
11
1879
by: BoloBaby | last post by:
OK, check this out... I have a form with a panel control and button on it (outside the panel control). I have two event handlers - one handles the click event of the button on the form. The...
17
2986
by: Justin Emlay | last post by:
I'm hopping someone can help me out on a payroll project I need to implement. To start we are dealing with payroll periods. So we are dealing with an exact 10 days (Monday - Friday, 2 weeks). ...
7
2296
by: Daniel | last post by:
hi guys i have never understood this so i am hoping someone can help. I have had errors in my app before where on closing it down i get a NullReferenceException error thrown BUT no line number...
3
1749
by: Rahul | last post by:
Hi, Is there a way to get the line numbers to display in the exception when you have published your web site? Thanks Rahul
7
6622
by: Digital Puer | last post by:
Hi, I am interested in catching exceptions and printing the line number and file name of where the exception occurred, like what is done in Java. For example, when vector's at() accesses beyond...
17
1713
by: Christoph Zwerschke | last post by:
I'm just reading PEP 3107 (function annotations) and wonder why exceptions are not mentioned there. I think it would be helpful if one could specify which exceptions can be raised by a function,...
0
7124
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
7163
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
7200
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
7375
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
5460
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3078
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1416
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
651
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
287
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.