32
votes

I'm trying to Remote Debugging a Windows Forms Application (C#), but i'm always getting this error:

Unable to connect to the Microsoft Visual Studio Remote Debugging Monitor named 'XXX. The Visual Studio Remote Debugger on the target computer cannot connect back to this computer. Authentication failed. Please see Help for assistance.

I tried to config according to the MSDN guides but i was not able to make it work.

My setup:

  • Development Computer - XP (x86) that is connected to a domain.
  • Test Computer - Vista (x86) that is NOT connected to a domain.
  • I have network connection between the machines.
  • I created a local user in the Test computer (user1) with the name of my domain user that I run the Visual Studio (mydomain\user1). setup the same password.
  • On The Test Computer i'm running "msvsmon.exe" as application (not as services), i'm running it using "runas" command with the user that i have created. (user1):

    runas /u:user1 msvsmon.exe

Can Someone help me please?

Thanks.

6
Voting up just because you asked the question well & included good data.Jay Bazuzi

6 Answers

7
votes

This is how it worked for me:

Remote computer: Microsoft Virtual PC, "IHS\RDM" attached to my corporate domain, logged in as jdoe, administrator account.

Local computer: Attached to local domain, logged in as jdoe, administrator account.

1) remote computer: install rdbgsetup.exe (from Visual Studio 2005\Disk 2\Remote Debugger\x86)

2) Remote computer: RUNAS /user MYDOMAIN\jdoe /netonly msvsmon

3) Remote computer: msvsmon->Tools->permissions add user "MYDOMAIN\jdoe" (I have to do this every time I re-start)

4) local computer: run msvsmon.

5) local computer, msvsmon->Tools->permissions, add object types: "computers", "IHS\RDM"

6) local computer, vs2005->debug->attach to process. Transport: Default, Qualifier: jdoe@RDM

7) Refresh, and voila; a process list!

9
votes

The problem that I had is that I had 2 users:

mydomain\user1
mytestmachine\user1

that is not correct (according to Gregg Miskely) i needed to define a local user in my development computer, for example:

mydevcomputer\debug
mytestmachine\debug

with the same password and run the VS2008 and the Debugging Monitor with this user:

2
votes

Gregg Miskely has a blog post on why the service account needs to have admin privileges (when set up that way). One of the points is that the user account, in your case the user on the Test machine, must have privileges for connecting back to the other computer. It sounds like you are hitting a case where the account mydomain\user1 has insufficient privileges to connect to your development computer.

If that doesn't help perusing Gregg's blog posts, sending him mail could help.

1
votes

Does TESTCOMPUTER\user1 have the same password as mydomain\user1?

You can also try running msvsmon.exe on the target computer instead of the Remote Debugging Service. You can use "Run As..." to run it under various credentials. Once you get things working with msvsmon,exe you should be able to install (or re-enable) the Remote Debugger Service having it run under those credentials.

EDIT:

You should be able to use the Permissions property page in msvsmon.exe to set up the appropriate debugging permissions for your domain user on the target machine:

http://msdn.microsoft.com/en-us/library/ms164722.aspx

1
votes

So you're a developer and one of your users got an exception, and you want to debug it remotely without closing the exception window, but they're logged on as a different user account. As it turns out, you can debug their application, but it gets tricky.

0) You still need matching local accounts on both the remote app machine and the local Visual Studio machine, which means adding an account to the user's computer.

1) You need to use runas with the /netonly option. Open a command prompt to the folder where msvsmon is and type

runas /user:[user] /netonly msvsmon

This causes msvsmon to use the user's credentials only when accessing the network (e.g. when msvsmon connects back to the local VS machine). msvsmon will get upset if you call it with runas without using /netonly.

2) You need to add permissions for the local Visual Studio machine to connect the remote application machine, via the Remote Debug Monitor's Tools->Permissions menu.

0
votes

So I can't reply without an account, and I can only reply to my own comments, but my registered account is separate from the anonymous account I posted from, so this has to be a "new answer". Sorry.

baget - when I made this work earlier today, I created a local account on both the Remote Debug Monitor PC and Visual Studio PC. RDM was not on the domain, VS was. Both local accounts are administrator with credentials identical to my domain account. From a different account (also administrator) I called runas from an elevated prompt with the netonly switch. You may or may not need to provide your domain with the username, but since the passwords should all match I don't think it matters much.

Don't forget to adjust your permissions in the RDM to allow the user account running VS to connect with Debug privileges. It's pretty picky about who it lets you add to the list, so if you don't create the local account first you'll get pretty frustrated. And if you're running RDM under a different user account name, you have to use the full server name when trying to attach to the remote computer; if you run both RDM and VS from the same user account then you can get away with just the computer name.