Process.Attach Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Causes the debugger to attach this process.
public:
void Attach();
public:
void Attach();
void Attach();
[System.Runtime.InteropServices.DispId(1)]
public void Attach ();
[<System.Runtime.InteropServices.DispId(1)>]
abstract member Attach : unit -> unit
Public Sub Attach ()
- Attributes
Examples
The following example demonstrates how to use the Attach method.
public static void Attach(DTE dte)
{
EnvDTE.Processes processes = dte.Debugger.LocalProcesses;
foreach(EnvDTE.Process proc in processes)
if(proc.Name.IndexOf("Target.exe") != -1)
proc.Attach();
}
Shared Sub Attach(ByRef dte As EnvDTE.DTE)
Dim processes As EnvDTE.Processes = dte.Debugger.LocalProcesses
For Each proc As EnvDTE.Process In processes
If proc.Name.IndexOf("Target.exe") <> -1 Then
proc.Attach()
End If
Next
End Sub