共用方式為


Process.Detach(Boolean) Method

Definition

Causes the debugger to detach from this process.

void Detach(bool WaitForBreakOrEnd = true);
[System.Runtime.InteropServices.DispId(2)]
public void Detach (bool WaitForBreakOrEnd = true);
[<System.Runtime.InteropServices.DispId(2)>]
abstract member Detach : bool -> unit
Public Sub Detach (Optional WaitForBreakOrEnd As Boolean = true)

Parameters

WaitForBreakOrEnd
Boolean

Set 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.

Attributes

Examples

The following example demonstrates how to use the Detach method.

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  

Remarks

This method causes the debugger to detach from the current process.

Applies to