473,748 Members | 2,685 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1857
"Rotsey" <ma***********@ RemoveThis.optu snet.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/#LineNumberMeth odName>

--
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.optu snet.com.au> escribió en el mensaje
news:u1******** ******@TK2MSFTN GP10.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
2841
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 difficult to debug those procs. Line number have always been there in Oracle messages. When I Googled on this, I saw some people showing DB2 Stored Proc error messages with line numbers in them (like LINE NUMBER=1285), which makes me believe that...
5
1950
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 current Assembly's name, one can use this... System.Reflection.Assembly.GetExecutingAssembly().GetName().Name
3
1353
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 line within the code that the error occurred? I do not see a property that tells me that.
10
5253
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 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...
2
4763
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 causing a particular error message to appear? Thanks John Ivey South Pike School District
9
4307
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 using sid, and I mean not even a word, or even part of a word, in that document or any of the include documents.
3
2814
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 message. So far, I have found that you would have to modify the custom error (500;100) on the IIS to point to your own error page to be able to use the Server.GetLastError object.
7
2312
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 given. I have put try catch state,ents to catch it around every method that fires during shutdown and none seem to be the cause, due to the lack of line number i am literally guessing where it could be? What else can i do?
4
3005
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") _prtSKU = myDLReader.GetString("prtSKU") _prtPic = myDLReader.GetString("prtPic") _prtRsvQty = myDLReader.GetInteger("prtRsvQty")
0
8995
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8832
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9381
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9332
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9254
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6799
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4608
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3316
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 we have to send another system
3
2217
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.