Home Dashboard Directory Help
Search

Visual Studio 2010 Debugger Bug by Paz013


Status: 

Closed
 as External Help for as External


1
0
Sign in
to vote
Type: Bug
ID: 776916
Opened: 1/18/2013 10:37:02 AM
Access Restriction: Public
0
Workaround(s)
view
0
User(s) can reproduce this bug

Description

This is a really odd issue. We have a Try Catch with multiple Catch blocks. The first Catch block has no code, just a comment.

Try
'Some Code
Catch ex As ThreadAbortException
'Do Nothing
Catch ex As Exception
HandleException(ex)
End Try

If an exception other than a ThreadAbortException is thrown, it is caught by the second Catch, as expected. However, when stepping through code in VS2010, the ex object is Nothing in that case. So far, we have found two ways to "fix" this issue.

Fix 1: Rename the first exception variable.

Try
'Some Code
Catch tex As ThreadAbortException
'Do Nothing
Catch ex As Exception
HandleException(ex)
End Try
Fix 2: Add any line of code to the first Catch block.

Try
'Some Code
Catch ex As ThreadAbortException
Dim i As Integer = 1
Catch ex As Exception
HandleException(ex)
End Try

Now, we know an empty catch block is bad practice. It is simply used to demonstrate the bug. The bug is that ex should NOT be nothing in the very first case when stepping through the code and an exception other than ThreadAbortException is caught.
Details
Sign in to post a comment.
Posted by Microsoft on 1/20/2013 at 11:50 PM
The product team itself no longer directly accepting feedback for Microsoft Visual Studio 2010 and earlier products. You can get support for issues with Visual Studio 2010 and earlier by visiting one of the resources in the link below:
<http://msdn.microsoft.com/en-us/vstudio/cc136615.aspx>

Sorry for the inconvenience.
Posted by Microsoft on 1/18/2013 at 10:51 AM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(http://support.microsoft.com)
Sign in to post a workaround.