|
|
Title | Use the DebuggerHidden attribute in VB .NET |
Description | This example shows how to use the DebuggerHidden attribute in VB .NET. |
Keywords | DebuggerHidden, attribute, VB.NET, property |
Categories | VB.NET |
|
|
The DebuggerHidden attribute tells the Visual Basic debugger that a method is hidden from the debugger. The debugger will not stop at breakpoints set in the code and will not step through the code. However, it does pause on the line that called the method if there is a breakpoint inside the method.
This can be very annoying. For example, suppose you set five breakpoints in the method. As you press F5 repeatedly, the program stops on the line thaht calls the method five times, once for each breakpoint.
In this example, the debugger will not step through subroutine IsHidden but will step through subroutine NotHidden normally.
|
|
Private Sub btnGo_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles btnGo.Click
IsHidden()
NotHidden()
End Sub
<DebuggerHidden()> _
Private Sub IsHidden()
' Try setting break points on these lines
' and stepping through the routine.
Dim i As Integer
i = 1
i = 2
i = 3
End Sub
Private Sub NotHidden()
' Try setting break points on these lines
' and stepping through the routine.
Dim i As Integer
i = 1
i = 2
i = 3
End Sub
|
|
|
|
|
|