Arian Kulp's Blog
opinion, insight, and occasional code

Remote Debugging with Visual Studio 2005

Friday, January 13, 2006 7:34 PM

I do a lot of development on VMWare and Virtual PC.  I don't even have Visual Studio installed on my primary machines.  When I write code that I want to run on my primary machine (like my time tracker), everything is usually fine, but sometimes I want to debug it.  Restarting the app on the virtual machine may not reproduce a given problem.  I've noticed before that the Debug | Attach to Process menu command seems to allow you to connect to proceses on other machines.  I never realized what that entailed though.

It turns out that (unless you are on a domain) you need to create matching accounts on both machines, and turn off guest impersonation.  This is important on non-domain machines, allowing a user from another machine to authenticate as a matching-named local user on the other machine.  Generally, guest access means that any user from another machine authenticates as “Guest” and gets generic permissions.

Once permissions are setup, you need to decide the remote debuggine options on the machine running the process to debug.  Run the remote debugger process as a service or stand-alone, it doesn't matter.  Don't enable Anonymous access thinking it's easier.  Anonymous access will not work for managed coode -- most likely the reason you are trying it to begin with!

I finally got it to work.  I couldn't find a nice tutorial on it, and if interest warrants, I'll create one.  It was nice getting it to work finally!

UPDATE (5/16/2006): I got an email from a gentleman, Plácido Bisneto, who confirmed that the Visual Studio Remote Debug service must be running as the same user as the user running Visual Studio (even if you are just creating same-named accounts on two machines).  Also, reading his message in GMail, there was a relevant link displayed to me: http://msdn.microsoft.com/netframework/archive/default.aspx?pull=/library/en-us/dnwxp/html/xpsp2remotedebug.asp.  This has some really good information for remote debugging and acts as a step-by-step walkthrough.  Though the information is easy-to-follow and theoretically is more flexible, it would be nice to be able to configure in one or two clicks!

Comments have been closed on this topic.