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

error line number

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 info.

Is there a way of getting the line number when in release mode?????

Thanks
Apr 3 '06 #1
3 1839
"Rotsey" <ma***********@RemoveThis.optusnet.com.au> schrieb:
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 info.

Is there a way of getting the line number when in release mode?????


I don't know of a way. However, you could manually insert line numbers for
debugging purposes:

<URL:http://dotnet.mvps.org/dotnet/code/techniques/#LineNumberMethodName>

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Apr 3 '06 #2
This works under 2003, I haven't loaded 2005 yet.

Menu
Project -> Properties

Set Configuration to Release
Conifiguration Properties -> Build
Check "Generate Debugging Information"

You will need to include the generated ".pdb" file with your
application. I haven't noticed any speed decrease.

Your error handler code can include ex.stacktrace in a message box,
which is fantastic for finding an offending line of code, and how it
got there.

Shane

Apr 3 '06 #3
Supposedly the Release configuration should not generate a .pdb file since
at that point the app should have been tested (using the Debug
configuration). If you want line numbers at Release configuration without
the .pdb file you have to add them to the code and use the Erl function
(like in VB6). My add-in has a feature to add line numbers to the code.

--

Best regards,

Carlos J. Quintero

MZ-Tools: Productivity add-ins for Visual Studio
You can code, design and document much faster:
http://www.mztools.com
"Rotsey" <ma***********@RemoveThis.optusnet.com.au> escribió en el mensaje
news:u1**************@TK2MSFTNGP10.phx.gbl...
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 info.

Is there a way of getting the line number when in release mode?????

Thanks

Apr 5 '06 #4

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

Similar topics

9
by: kangaroo | last post by:
Hi guys, when we run a stored proc and it results into an unhandled error, the error message returned by db2 udb does not contain a line number that caused an error. This makes it pretty...
5
by: Mark Kamoski | last post by:
Hi Everyone-- How can one get the line number of where an error was thrown and/or caught? For example, note the following, for use at any given point in a piece of code: ....to get the...
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...
10
by: Al | last post by:
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...
2
by: johnivey | last post by:
I have a large query that I am trying to debug in query analyzer. However, the errors I get have no line number or reference to where they are failing. How can I find out what line in the query is...
9
by: Adrienne Boswell | last post by:
I am getting this error: Error Type: Microsoft VBScript runtime (0x800A000D) Type mismatch: 'sid' /beta/files/index.asp There is no line number, and there is absolutely nothing on that page...
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...
7
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...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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
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,...

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.