Process.Detach Method
Causes the debugger to detach from this process.
Namespace: EnvDTE
Assembly: EnvDTE (in EnvDTE.dll)
Syntax
'Declaration
Sub Detach ( _
WaitForBreakOrEnd As Boolean _
)
void Detach(
bool WaitForBreakOrEnd
)
void Detach(
[InAttribute] bool WaitForBreakOrEnd
)
abstract Detach :
WaitForBreakOrEnd:bool -> unit
function Detach(
WaitForBreakOrEnd : boolean
)
Parameters
WaitForBreakOrEnd
Type: System.BooleanSet to true if the debugging session should stop only when it reaches a break or the end. Set to false if you intend to stop debugging, but you have to perform other tasks in the macro even before the debugger breaks or ends. For more information, see Breaking Execution.
Remarks
This method causes the debugger to detach from the current process.
Examples
The following example demonstrates how to use the Detach method.
To test this method
Run the target application in the debug mode. Make sure that the application contains an infinite loop.
Set the breakpoint inside the infinite loop.
Run the add-in.
public static void Detach(DTE dte)
{
EnvDTE.Processes processes = dte.Debugger.DebuggedProcesses;
processes.Item(1).Detach(true);
}
Shared Sub Detach(ByRef dte As EnvDTE.DTE)
Dim processes As EnvDTE.Processes = dte.Debugger.DebuggedProcesses
processes.Item(1).Detach(True)
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.