Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.

Debugger Interface

The Debugger object is used to interrogate and manipulate the state of the debugger and the program being debugged.

Namespace: EnvDTE
Assembly: EnvDTE (in envdte.dll)

<GuidAttribute("338FB9A0-BAE5-11D2-8AD1-00C04F79E479")> _
Public Interface Debugger
Dim instance As Debugger

/** @attribute GuidAttribute("338FB9A0-BAE5-11D2-8AD1-00C04F79E479") */ 
public interface Debugger
public interface Debugger

The debugger is available through the DTE object by way of its Debugger property, as shown in the example below. One debugger object is available for each instance of the development environment.

The following example demonstrates how to use Debugger object.

Imports EnvDTE
Imports System.Diagnostics

Public Module Module1
    ' This function returns true if the debugger is actively debugging.

    Function IsDebugging() As Boolean
        Dim debugger As EnvDTE.Debugger
        debugger = DTE.Debugger

        If (debugger Is Nothing) Then
            MsgBox("Debugger doesn't exist! Fatal error.")
            IsDebugging = false
            IsDebugging = (debugger.CurrentMode <> dbgDebugMode.dbgDesignMode)
        End If
    End Function
End Module

Community Additions

© 2015 Microsoft