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

basic debugging question

Bob
In code when I'm handling an exception, I'd like to be able to tell the
debugger, if it's attached, to break and then navigate to where the
exception was thrown, which won't be where I break. Is that possible?

Bob

Nov 20 '05 #1
2 911
Bob,
I don't know how to do what you are asking, except in an add-in, possibly,
but if you just want to know where the line that caused the exception is, do
the following:

In the Solution Explorer, right click on the project, click the Properties
menu option. In the dialog, click on Configuration Properties, Build, and
check the Generate Debugging Information. That will put line numbers in the
PDB. When you get an exception, trap the ex as System.Exception, print out
(msgbox) ex.ToString and you will get the failing line. You can then Set
Next Statement to the offending line to be able to check the status of
variables at the time of the failure.

HTH
Les Smith
http://www.KnowDotNet.com
"Bob" <no****@nowhere.com> wrote in message
news:OB****************@TK2MSFTNGP09.phx.gbl...
In code when I'm handling an exception, I'd like to be able to tell the
debugger, if it's attached, to break and then navigate to where the
exception was thrown, which won't be where I break. Is that possible?

Bob

Nov 20 '05 #2
Bob
Thanks. You're right, an addin is the way to go. Maybe I can force VS.Net to
break execution on any exception throw, which is where I usually need to
look.

"Les Smith" <le*@nospamplz.knowdotnet.com> wrote in message
news:uI**************@TK2MSFTNGP12.phx.gbl...
Bob,
I don't know how to do what you are asking, except in an add-in, possibly,
but if you just want to know where the line that caused the exception is, do the following:

In the Solution Explorer, right click on the project, click the Properties
menu option. In the dialog, click on Configuration Properties, Build, and
check the Generate Debugging Information. That will put line numbers in the PDB. When you get an exception, trap the ex as System.Exception, print out (msgbox) ex.ToString and you will get the failing line. You can then Set
Next Statement to the offending line to be able to check the status of
variables at the time of the failure.

HTH
Les Smith
http://www.KnowDotNet.com
"Bob" <no****@nowhere.com> wrote in message
news:OB****************@TK2MSFTNGP09.phx.gbl...
In code when I'm handling an exception, I'd like to be able to tell the
debugger, if it's attached, to break and then navigate to where the
exception was thrown, which won't be where I break. Is that possible?

Bob



Nov 20 '05 #3

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

Similar topics

1
by: Troy Erickson | last post by:
I am very new to web developing. What is the best way to create a web project. I will be using asp with vs.net. What do most people do for computers more specifically. Do I remote debug to a...
3
by: Nosnets | last post by:
I am learning from a text book. Debugging breakpoints does not work. The Breakpoint properties dialogue contains the following comment "The breakpoint will not currently be hit. No symbols have...
0
by: ZMan | last post by:
Scenario: This is about debugging server side scripts that make calls to middle-tier business DLLs. The server side scripts are legacy ASP 3.0 pages, and the DLLs are managed DLLs...
7
by: Frank | last post by:
I'm running a mixed ASP / ASP.NET environment. I can use the debugger in for the ASP.NET code, no problems. But when I turn on ASP Debugging for the project, I get the error message: "Error...
2
by: Alex Clark | last post by:
Hi All, My system: WinXP Pro, VS.NET 2003, SQL Server Personal Edition. I'm having problems with my old favourite demon, SQL Debugging from within VS.NET. I have to say I've found this...
1
by: sher | last post by:
I just reinstalled Visual Basic.NET because I was receiving the following error: "Error while trying to run project. Unable to start debugging. No such interface supported." BUT, I am still...
0
by: JT | last post by:
Hi, I've just realized that I'm not as smart as I thought I was. I have no problem creating Windows apps, class libraries, using windows references, etc. But, I absolutely cannot create and...
8
by: razael1 | last post by:
I am putting debugging messages into my program by putting blocks that look like this: #ifdef DEBUG errlog << "Here is some information"; #endif All these #ifdef blocks make the code bulky and...
25
by: Marco | last post by:
Hi everyone. I've been trying to move some small applications written in vb.net 2003 to vb.net 2005 express just for testing purposes. I have noticed so far that the applications seem to run ...
1
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: 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...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.