DetachAll Method
This documentation is archived and is not being maintained.

Debugger.DetachAll Method

Detaches from all attached programs.

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

void DetachAll ()
void DetachAll ()
function DetachAll ()

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

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.");
}
Show:
© 2016 Microsoft