Export (0) Print
Expand All

Process.Attach Method

Causes the debugger to attach this process.

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

void Attach()

The following example demonstrates how to use the Attach method.

To test this method

  1. Run the target application in the nondebug mode. Make sure that the application contains an infinite loop.

  2. Run the add-in.

  3. Set the breakpoint inside the infinite loop.

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)

© 2015 Microsoft