Home
Search
 
What's New
Index
Books
Links
Q & A
Newsletter
Banners
 
Feedback
Tip Jar
 
C# Helper...
 
XML RSS Feed
Follow VBHelper on Twitter
 
 
 
MSDN Visual Basic Community
 
 
 
 
 
 
TitleUse the DebuggerHidden attribute in VB .NET
DescriptionThis example shows how to use the DebuggerHidden attribute in VB .NET.
KeywordsDebuggerHidden, attribute, VB.NET, property
CategoriesVB.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
 
 
Copyright © 1997-2010 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
  Updated