Quantcast
Channel: Visual Studio Integrate forum
Viewing all articles
Browse latest Browse all 4410

How do I automate attaching the debugger to a remote process?

$
0
0

I have remote debugging set up and can debug from my host machine (Windows 7, 64-bit, UAC Enabled, with Visual Studio running as Administrator) to my guest machine with no problems at all(Windows 7, 32-bit, Remote Debugger running as a service). Connecting manually using the menu "Attach Process", entering the remote machine and specifying the process works fine.

I want to automate attaching to a remote process using the debugger but I cannot automate it using the code generated by the in-built macro recorder:

Try
Dim dbg2As EnvDTE80.Debugger2 = DTE.Debugger
Dim transAs EnvDTE80.Transport = dbg2.Transports.Item("Default")
Dim dbgeng(2)As EnvDTE80.Engine
d
bgeng(0) = trans.Engines.Item("Managed (v4.0)")
dbgeng(1) = trans.Engines.Item("Native")

Dim proc2As EnvDTE80.Process2 = dbg2.GetProcesses(trans,"TheMachineName").Item("myremoteprocessname.exe")

proc2.Attach2(dbgeng)     

Catch exAs System.Exception

            MsgBox(ex.Message)

EndTry

I get the error:

"The Microsoft Visual Studio Remote Debugging Monitor (MSVSMON.EXE) does not appear to be running on the remote computer. Please see Help for assistance".

However, it definitely IS running because I can attach manually. I suspect the problem is with the machine name which is really a qualiifier - can I please ask what qualifier do I need to use when I want to attach to the remote debugger that is running as a service?

Cheers!

Grey Ham

PS: I realize I can set up F5 to do this, but I would prefer to use the extensibility API's...


Blog: http://www.havecomputerwillcode.com/blog


Viewing all articles
Browse latest Browse all 4410

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>