Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remote debug when user accounts do not match?

How can I configure Visual Studio remote debugging when:

  1. My developer machine is a member of an AD domain, and my username is "DevelopersName".
  2. The "remote" machine is on the same Ethernet segment, but is not part of the domain.
  3. The "remote" machine must run software under "RemoteUserName".

Most documentation I can find suggests that you need have both machines in the same domain and with identical usernames. That's not possible here.

I could possibly add my username to "remote", but the software still needs to run under "RemoteUserName.

If it helps, I could add 2nd network card to my developer machine and directly connect the "remote" machine.

Using VS2008, but will be moving soon to VS2010.

Thank you.

like image 824
nonot1 Avatar asked Jan 21 '11 17:01

nonot1


3 Answers

Sorry, but I've just spent the last 10 hours trying to debug your exact problem. My findings are not good.

You need to get your accounts synced, especially if you are using your remote app to connect to other systems in your SOA environment, ie: Sharepoint, AD.

You can to some extent get remote debugging to work, if you create an account on your local machine with the same name as that of your remote machine (lets do it like this rather rather than working with the domain account).

You then need to make sure the remote service is running under this account, and its a member of the administrators group. And by this I mean hold down control, and right click run as - with the remote debugger, and select the user (not required if remote server is logged in as the required user).

Run the wizard it will open the required ports, use Authentication, because non authentication won't debug managed code. Breakpoints are never met, and there is nothing you can do about this.

On your local dev machine, log off your domain account, and log onto the local account with matching name as the account on server thats running the remote service.

Now you stand a change of remote debugging. If you can't do any of the above, sorry there is no workaround, its entirely dependent on the user account and having the right permissions.

like image 124
JL. Avatar answered Oct 12 '22 05:10

JL.


If you don't want to create a local account, try starting our debugger via command prompt using the following command:

runas /user:[user@machinename] /netonly [debugger.exe]

E.g.:

 runas /user:john@mypc123 /netonly devenv.exe
like image 41
Xantos Avatar answered Oct 12 '22 05:10

Xantos


I assume it's managed debugging you're talking about (for native debugging there's a remote debugging solution with no authentication). In this case, I would suggest that you use a local user to launch the debugger on your machine. If this local user's name and password match "RemoteUserName"'s name and password, it should work.

(Note that this does not preclude you from using the AD account to log in to your workstation, you just need to set up another account and use runas to launch Visual Studio.)

like image 1
Sasha Goldshtein Avatar answered Oct 12 '22 05:10

Sasha Goldshtein