all groups > visual studio .net debugging > june 2007 >
You're in the

visual studio .net debugging

group:

exception debugging behavior in threads


exception debugging behavior in threads Chuck P
6/6/2007 8:16:00 AM
visual studio .net debugging:
When I run the following code and I single step the debugger it just keeps
bouncing on the last line; the time changes everytime so I assume it is
getting called again and again.

protected void Button1_Click(object sender, EventArgs e)
{
Thread th = new Thread(new ThreadStart(threadtarget));
th.Name = "a background thread";
th.IsBackground = true;
th.Start();
}

private void threadtarget()
{
Thread.Sleep(1000);
throw new Exception("exception in thread: " +
DateTime.Now.ToLongTimeString());
}

RE: exception debugging behavior in threads jetan NO[at]SPAM online.microsoft.com (
6/7/2007 12:00:00 AM
Hi Chuck,

I will perform some research on this issue and get back to you ASAP. Thanks.

Best regards,
Jeffrey Tan
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
RE: exception debugging behavior in threads jetan NO[at]SPAM online.microsoft.com (
6/8/2007 12:00:00 AM
Hi Chuck,

Sorry for letting you wait.

Yes, I can reproduce this behavior. This is the effect of the Exception
Assistant(EA).

What happens is that the Exception Assistant automatically undwinds the
exception back to the line that through the exception. That is, it will
reset the EIP register to point to the start of this source code
statement.(At low level, it will reset to the start of the machine code
block of this statement, you can confirm this by using Disassembly window).
If you press F10 or F11, it will re-execute the line that throws the
exception.

The theory was that this way you can use Edit&Continue to fix your code. If
you don't like this behavior, you can go to
Tools->Options->Debugging->Enable the exception assistant and turn it off.

Hope this helps.

Best regards,
Jeffrey Tan
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

RE: exception debugging behavior in threads Chuck P
6/12/2007 9:08:01 AM
Thanks Jeffery,

I was writing an HTTP Handler and trying to debug it was troublesome when
threads threw exceptions.

As you suggested, I turned off the Exception Assistant and that helped,
quite a bit.

RE: exception debugging behavior in threads jetan NO[at]SPAM online.microsoft.com (
6/13/2007 2:56:42 AM
Hi Chuck,

Thank you for confirming the status. If you need further help, please feel
free to post, thanks.

Best regards,
Jeffrey Tan
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

AddThis Social Bookmark Button