Google Answers Logo
View Question
 
Q: Current Exception in Visual Studio .NET Debugger ( Answered,   0 Comments )
Question  
Subject: Current Exception in Visual Studio .NET Debugger
Category: Computers > Programming
Asked by: garyclarke-ga
List Price: $20.00
Posted: 02 Jul 2002 14:36 PDT
Expires: 01 Aug 2002 14:36 PDT
Question ID: 35971
When an exception is thrown in VS .NET, debugger gives the option to
"Break" into code. How does one determine details of exception that
caused the break. The initial dialog window provides the error
description but does not provide additional details such as the inner
exceptions.
Answer  
Subject: Re: Current Exception in Visual Studio .NET Debugger
Answered By: solidcontent-ga on 12 Jul 2002 10:15 PDT
 
Hi garyclarke-ga:

The Break into the debugger option is there just to identify the
particular statement that is causing that exception. It won't give you
the details of the exception.
For having details of the exception you need to have an exception
object, you have an exception object when you catch an exception for
example:

try
{
  //write code that causes exception here
}
catch(Exception ex)
{
   Debug.WriteLine(ex.InnerException, "Inner Message");
}		
		
Here, once you break into the code you can use Step Into key (usually
F11) to step in the code, if there is a matching catch block it will
be encountered and there you can capture the inner property etc. using
Debug.WriteLine or Trace.WriteLine messages and any other logic that
suits your requirement.

So the point is, breaking into the code just identifies the line of
code causing the exception. To get the detail of exception, catch it
so that you have an exception object available and use the properties
of that object to get information about the exception.

I hope this helps,
SolidContent-ga
Comments  
There are no comments at this time.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy