views:

264

answers:

1

I'm using Visual Studio 2003, and I have a macro similar to this:

    Dte.Debugger.DetachAll()

    For Each proc As EnvDTE.Process In DTE.Debugger.LocalProcesses
        If proc.Name.IndexOf("ehexthost.exe") <> -1 Then
            proc.Attach()
        End If
    Next

The first time use the macro, it works fine. Each subsequent time, even after I detach from the process, the .Attach() doesn't seem to do anything.

The same thing happens as I step through the macro... the proc.Attach() gets called on the correct process, but nothing happens.

One note: when viewing the process in the Processes window, the Type column for my process shows ".NET, Win32".

Any idea what's happening?

A: 

Try calling the following before running your Macro. It will ensure VS is attached to no process's before attaching to a new one.

Dte.Debugger.DetachAll()
JaredPar
No luck. Same behavior... it runs and exits.
Mark A Johnson