Kommentar
Åtkomst till den här sidan kräver auktorisering. Du kan prova att logga in eller ändra kataloger.
Åtkomst till den här sidan kräver auktorisering. Du kan prova att ändra kataloger.
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:
Use the infinite loop in the target application code.
Run the target application in the debug mode.
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
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.