473,320 Members | 1,831 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,320 software developers and data experts.

determining line numbers upon error

Hi,
I'm looking for some advice and guidance. I have a program in vb.net and I
know that when it's run and the pdb file is available that the exception
will contain the line number of the error. Obviously when trying to track
down an error this is extremely valuable. I've also heard people say that
when you distribute your app, you should compile it without debug and
without the pdb file. In this case the exception has no error numbers.

My question is 2 part. First why shouldn't you distribute a debug version
with a pdb file. If an error occurs while a customer is running your
program the exact line number can be written to a log file and it greatly
speeds up the time necessary to find and fix the bug.

Second, assuming there are good reasons not to distribute a debug version,
does anybody know of a technique (other than updating a public variable with
an incrementing number every other line of code) that would help to narrow
down where an error occurs. I know about the unsupported ERL function but
I believe that works only with an ON Error stmt, and I use structured Try
Catch blocks throughout the program.

Any Ideas? Thanks for any help...
Aug 10 '06 #1
2 1703
My question is 2 part. First why shouldn't you distribute a debug version
with a pdb file. If an error occurs while a customer is running your
program the exact line number can be written to a log file and it greatly
speeds up the time necessary to find and fix the bug.
Because the customer shouldn't be debugging and fixing your code. Sending
out an assembly compiled with debug mode turned on generally results in
slower executing code as well.
Second, assuming there are good reasons not to distribute a debug version,
does anybody know of a technique (other than updating a public variable
with an incrementing number every other line of code) that would help to
narrow down where an error occurs. I know about the unsupported ERL
function but I believe that works only with an ON Error stmt, and I use
structured Try Catch blocks throughout the program.
If you are using Try...Catch statements, create log entries about any
exceptions you encounter. The line number is not paramount.
>
Any Ideas? Thanks for any help...

Aug 10 '06 #2

Hi John
why shouldn`t you deploy a debug version ?? well the answer is simple
performance and you make it easier for someone to reverse engineer your
application if you do so .

Ideas ??

Make sure your application is tested sufficiently , if you encounter a
customer with a problem , just ask them the parameters that let the error
occur and test it in your dev environment .
regards

Michel Posseth [MCP]

"JohnR" wrote:
Hi,
I'm looking for some advice and guidance. I have a program in vb.net and I
know that when it's run and the pdb file is available that the exception
will contain the line number of the error. Obviously when trying to track
down an error this is extremely valuable. I've also heard people say that
when you distribute your app, you should compile it without debug and
without the pdb file. In this case the exception has no error numbers.

My question is 2 part. First why shouldn't you distribute a debug version
with a pdb file. If an error occurs while a customer is running your
program the exact line number can be written to a log file and it greatly
speeds up the time necessary to find and fix the bug.

Second, assuming there are good reasons not to distribute a debug version,
does anybody know of a technique (other than updating a public variable with
an incrementing number every other line of code) that would help to narrow
down where an error occurs. I know about the unsupported ERL function but
I believe that works only with an ON Error stmt, and I use structured Try
Catch blocks throughout the program.

Any Ideas? Thanks for any help...
Aug 10 '06 #3

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

Similar topics

5
by: drew | last post by:
I am reading my textbook and doing the code examples in MS Visual C++ 6.0 for my next class beginning Jan 05. The textbook examples show line numbers. How do I get line numbers to show as I type in...
6
by: Kenneth Courville | last post by:
Hello, I'm looking for assistance with the Access object model. I know this is VB, but I'm building an Office Add-using C# directed at Access 2002. I'm literate in VB, so you can reply in VB... I...
19
by: Allagappan | last post by:
Hello everyone, Just check this code: #include<stdio.h> int main() { double a,b; scanf("%lf",&a); scanf("%lf",&b); printf("\nNumber a: %0.16lf",a);
5
by: Bob Day | last post by:
VS 2003, vb.net... Is there a way to determine the line number currently executing in your code, so you can log this line number information (e.g. via trace)? Thanks! Bob Day
2
by: Ben | last post by:
Hello all After years of playing developing stuff for fun and personal use I'm finally developing an app that I am intending to sell. As such, I'm trying to make it as reliable and stable as...
18
by: Ed Bitzer | last post by:
Can draw a line on my form with a button click event but cannot upon the Load event when I wish. No more line object so used the following: Dim bit As Bitmap = New Bitmap(Me.Width, Me.Height) Dim...
10
by: Daniel R. Rossnagel | last post by:
As I can determining if string can be turned to a numerico value?, since to contain alfanumeric data it returns an error to me. as I can avoid the following error? String str="123"; int valInt...
4
by: News | last post by:
Hi Everyone, The attached code creates client connections to websphere queue managers and then processes an inquiry against them. The program functions when it gets options from the command...
18
by: W. Watson | last post by:
See Subject. It's a simple txt file, each line is a Python stmt, but I need up to four digits added to each line with a space between the number field and the text. Perhaps someone has already done...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.