Partager via


Debugger2.DetachAll Method

Definition

Detaches from all attached programs.

public:
 void DetachAll();
public:
 void DetachAll();
void DetachAll();
[System.Runtime.InteropServices.DispId(2)]
public void DetachAll ();
[<System.Runtime.InteropServices.DispId(2)>]
abstract member DetachAll : unit -> unit
Public Sub DetachAll ()

Implements

Attributes

Examples

The following example demonstrates how to use the DetachAll method.

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();  

    EnvDTE80.Debugger2 debugger = (EnvDTE80.Debugger2)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  

Remarks

DetachAll attempts to detach from all attached programs. This operation can fail if attached process cannot be detached. See How to: Detach Programs for more information.

Applies to