Thursday, August 27, 2009

Remotely debugging managed code

So, with hopes of debugging managed code, you're running the Visual Studio Remote Debugger Monitor (msvsmon.exe) on the remote machine. Unfortunately, it will not let you connect to it from Visual Studio running on your local machine. You've tried the following steps to no avail:
  • You're running it as an administrator (or member of the administrators group) on an XP-SP* machine.
  • Your firewall has an exception for msvsmon.exe.
  • msvsmon.exe is using the default authentication setting (Windows Authentication).
In other words, you've read the documentation and followed the steps contained therein.

Despite these valiant efforts every time you try to connect to the remote debugger monitor from Visual Studio (ctrl+alt+p, transport=default, host set to the remote machine's WINS name) a wonderfully unhelpful error dialog pops up informing you that it can't find the remote debugger monitor.

A quick way to work around this is to:
  1. Create an account on the remote machine with the same username and password as the account on your local machine that is running Visual Studio.
  2. Put the account into the administrator's group on the remote machine.
  3. Run msvsmon.exe (it can be on a remote share) using the account you just created. This can be done by right clicking msvsmon.exe, choosing "Run As" then changing the logon and password.
As far as I can tell, the problem is that msvsmon.exe will only let you connect to it (with the transport that supports debugging managed code) using the credentials of the user under which it is running. Although it allows you to debug other user's processes once you've connected, it will not let you connect unless you're running it as you.

No comments :

Post a Comment