A journey to .Net

Using Visual Studio Remote Debugger without domain user

Saturday, 3 April 2010 10:51 by mBerube
(Also available in: français)

Looking for the bug I talked about in my previous post, I had to run remote debugger on my QA server. I do it daily at work but we are in a domain so as long as your user has administrator rights on the remote server, you're good to go. But at home, I don't have a domain so it's a little bit more complex. I did some search on the web and I get tricks and tips for different sites I've decided to put together here. For the examples, consider that setup:

  • A PC
  • A WS 2003 server running IIS 6.o under the default credentials (Network Service)
  • A PC user named MyLocalUser

Scenario 1 : MyLocalUser is administrator on Server

In that scenario, it's pretty simple. Simply make sure you have the remote debugger on the server (if not, copy it from PC, it's usually located at C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\Remote Debugger\x86) and start msvsmon . If you're logged on the server with MyLocalUser, you're done. It not, make sure to start msvsmon by right clicking it and use Run As.. option. Enter MyLocalUser credentials.

Your remote debugger is now running.

Finally, in Visual Studio, choose "Tools\Attach to process...", in Qualifier, enter the server name as given by the remote debugger (in our case, MyLocalUser@SERVER) and be sure to check "Show Processes for all users" and "Show processes in all sessions". Choose w3wp process and you're ready to debug.

Scenario 2 : MyLocalUser is not administrator on Server

If MyLocalUser isn't an administrator on the server (but is defined as an regular user) and you don't want to give it,  there's another solution. It's almost like scenario 1 but we'll create an account on both PC and server only for remote debugging purpose:

  1. Create an account (lets call it RemoteDbgUser) on PC and server with the same password. This account must be admin on the server but it's not required on PC.
  2. On the server, start the remote debugger with "Run as" and enter RemoteDbgUser credential.
  3. In Remote Debugger, under "Tools\permissions", give access to MyLocalUser to debug (see image below).
  4. On PC, in Visual Studio, go to "Attach process" and enter RemoteDbgUser@SERVER as qualifier

Voilà ! I hope it will help you, it took me about an hour to figure that all so follow these steps and you'll save some extra time to make your project better

Thanks for reading

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Actions:   E-mail | del.icio.us | Permalink | Comments (0) | Comment RSSRss comment feed