Compartir a través de


Debugger.DetachAll Method

Detaches from all attached programs.

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

Syntax

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

Remarks

DetachAll attempts to detach from all attached programs. This operation can fail if any attached process cannot be detached. See <PAVE OVER> How to: Detach All Processes for more information.

Examples

The following example demonstrates 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.

  4. The debugger is detached from the target application.

public static void DetachAll(DTE dte)
{
    // Setup the 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();

    dte.Debugger.DetachAll();
    owp.OutputString("Detached all processes.");
}
Shared Sub DetachAll(ByRef dte As EnvDTE.DTE)
    dte.Debugger.DetachAll()
    MessageBox.Show("Detached all processes.", "Debugger Test - DetachAll Test")
End Sub

.NET Framework Security

See Also

Reference

Debugger Interface

EnvDTE Namespace