Compartilhar via


Debugger3.DetachAll Method

Detaches from all attached programs.

Namespace:  EnvDTE90
Assembly:  EnvDTE90 (in EnvDTE90.dll)

Syntax

'Declaration
Sub DetachAll
void DetachAll()
void DetachAll()
abstract DetachAll : unit -> unit
function DetachAll()

Remarks

DetachAll tries to detach from all attached programs. This operation can fail if attached process cannot be detached. For more information, see <PAVE OVER> How to: Detach All Processes.

Examples

The following example shows how to use the DetachAll method.

To test this method:

  1. Use the infinite loop in the target application code.

  2. Run the target application in the debug mode.

  3. Run the add-in.

    The debugger is detached from the target application.

public static void DetachAll(EnvDTE80.DTE2 dte)
{
    // Setup debug Output window.
    Window w = 
    (Window)dte.Windows.Item(EnvDTE.Constants.vsWindowKindOutput);
    w.Visible = true;
    OutputWindow ow = (OutputWindow)w.Object;
    OutputWindowPane owp = ow.OutputWindowPanes.Add("DetachAll Method 
    Test");
    owp.Activate();

    EnvDTE90.Debugger3 debugger = (EnvDTE90.Debugger3)dte.Debugger;
    debugger.DetachAll();
    owp.OutputString("Detached all processes.");
}
Sub DetachAll()
    On Error Goto BadDetach
    DTE2.Debugger.DetachAll()
    Exit Sub

    BadDetach:
        MsgBox("Could not detach from all processes.")
End Sub

.NET Framework Security

See Also

Reference

Debugger3 Interface

EnvDTE90 Namespace