Microsoft KB Archive/823240

= BUG: Breakpoints that are added by macros are not highlighted in the source editor =

Article ID: 823240

Article Last Modified on 2/3/2006

-

APPLIES TO


 * Microsoft Visual Basic .NET 2003 Standard Edition
 * Microsoft Visual Basic .NET 2002 Standard Edition

-





SYMPTOMS
In a Microsoft Visual Basic .NET project, you have a macro that sets a breakpoint in the source code. When you use the Macros IDE command to programmatically set a breakpoint in the source code of the macro, you may notice that the breakpoint is set in the source code but that the line is not highlighted. However, when you run the application, the application stops running at the breakpoint that was set by Macros IDE.



STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.



Steps to Reproduce the Behavior
 Start Microsoft Visual Studio .NET. On the File menu, point to New, and then click Project. Click Visual Basic Projects under Project Types, click Console Application under Templates, and then click OK.  Replace the existing code with the following code for the Class1.vb class: Public Class Class1 Sub Main Dim x As Integer x = 5 x = 6 End Sub End Class  On the Tools menu, point to Macros, and then click Macros IDE. In the projects explorer pane, expand MyMacros, and then double-click Module1.</li>  Replace the existing code with the following code: Imports EnvDTE Imports System.Diagnostics

Public Module Module1 Sub macro Dim d As EnvDTE.Debugger = DTE.Debugger d.Breakpoints.Add(&quot;&quot;, &quot;Class1.vb&quot;, 4, 1) End Sub End Module </li> On the File menu, click Save MyMacros.</li> On the File menu, click Close and Return to close MyMacros.</li> On the Tools menu, point to Macros, and then click Macro Explorer.</li> In the Macro Explorer, expand MyMacros.</li> To run the application, click Start on the Debug. To stop running the application, click Stop Debugging on the Debug menu.</li> In Macro Explorer, expand Module1.</li> Right-click macro, and then click Run. You may notice that the breakpoint is set at line 4 in the source editor, but that the line is not highlighted.</li></ol>

<div class="references_section">