Remote Debugging in Visual Studio (VS2008), Windows Forms Application

20,613

Solution 1

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!

Solution 2

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:

Solution 3

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.

Solution 4

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

Solution 5

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.

Share:
20,613
EloHailwidis
Author by

EloHailwidis

Windows Driver Developer Software Engineer Computer Geek Maker Guitar Player

Updated on February 05, 2020

Comments

  • EloHailwidis
    EloHailwidis over 4 years

    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.

  • EloHailwidis
    EloHailwidis over 15 years
    They have the same password and i'm not running it as services, I'm running the exe file,
  • configurator
    configurator over 15 years
    I've read somewhere on MSDN that it is impossible to do that if there is no two-way full trust relationship between the two machines.
  • EloHailwidis
    EloHailwidis over 14 years
    But what is we have difference domain? or one computer is connected to a domain and other is not?