Unable to connect to the Microsoft Visual Studio Remote Debugging Monitor…

Remote Debugging is not something that typically comes into play when working on standalone applications. Well, maybe that’s not entirely true. My first exposure to remote debugging actually came about during some driver development I did back in the day – debugging a BSODing driver is best from a remote machine (and nowadays from a VM host..)

However, in the ever expanding world of distributed systems development, remote debugging can be key when the application being debugged is just a single node in a distributed system.

When it works, remote debugging is amazing. Well, actually it’s exactly the same as debugging a local application, but given that the application is actually running on a remote machine, which does not need to even have Visual Studio installed, it’s pretty cool.

However, there are numerous gotchas to getting remote debugging to work, and by talking about the blogtitle error message,  I am starting somewhere in the middle. The exact message is:

Unable to connect to the Microsoft Visual Studio Remote Debugging Monitor named ‘….’. The Microsoft Visual Studio Remote Debugging Monitor on the remote computer cannot connect to the local computer. Unable to initiate DCOM communication. Please see Help for assistance.

Error Message

‘…’ would be replaces by the IP address or machine name you are trying to debug.

So, at this point I am assuming that:

  • Visual Studio remote debugged is actually in stalled on the remote machine
  • Firewall is configured correctly – disabled is the best way to go for debugging remote debugging
  • You have set up an account on the remote computer with the same user name and password as the account you are debugging from, and have given it proper (admin) privileges.
The above points being removed from the equation, the error will occur when  “Remote Access for Anonymous Logon in DCOM” is disabled on the computer running Visual Studio. That is the computer you are debugging FROM.

During a Remote Debug session, the remote computer instantiates a connection back to the computer that is debugging it. Thus, you need to have proper permissions for this “callback”.

To enable anonymous DCOM access:

1) Start->Run->type ‘dcomcnfg’, and then press ENTER. Component Services opens.
2) In Component Services, expand Component Services, expand Computers, and then expand My Computer.
3) On the toolbar, click the Configure My Computer button. The My Computer dialog box appears.
4) In the My Computer dialog box, click the COM Security tab.
5) Under Access Permission, click Edit Limits. The Access Permission dialog box appears.
6) Under Group or user names, click ANONYMOUS LOGON.
7) Under Permissions for ANONYMOUS LOGON, select the Remote Access check box, and then click OK.
8) Restart the computer.

Cross fingers, and try your Remote Debug session again.

Hope this helps, let me know if you find any other gotchas.


Comments are closed.