Sep 29, 2010

Remote Debugging in Visual Studio 2008

I’m working on a project that uses custom hardware housed in a computer that runs Windows XP Embedded (32 bit). Since I can’t install Visual Studio in XPe I need to debug the application from my Windows 7 Pro (64 bit) laptop. The application will be written in C++/CLI. The user interface will be written in managed code and the majority of the application to control the custom hardware will be written in Native C++. Below is a 9.5 minute screencast showing how to set up remote debugging and some of the gotchas to watch out for.

I forgot about one security issue when making the screencast. On the remote computer use the Control Panel for Administration Tools->Local Security Policy.  Open the Local Policies and then Security Options. Scroll down to the Policy Network access: Sharing and security model for local accounts. Double-click and change the value from Guest Only – local users authenticate as Guest to Classic – local users authenticate as themselves.

Update: It’s handy to know that System.Diagnostics.Debugger.Break() and System.Diagnostics.Debugger.Launch() can be helpful in forcing your remote program to pause while you attach the debugger.

If you prefer text, there is an MSDN article that can get you started. The video shows a hard to type link for downloading the remote debugger from Microsoft. If you like British accents there’s another video tutorial available from Mike McNulty. It’s about twice as long but has a slightly different focus. As usual pushing the YouTube resolution to at least 480p makes the text much more legible.

About Me

My photo
Tod Gentille (@todgentille) is now a Curriculum Director for Pluralsight. He's been programming professionally since well before you were born and was a software consultant for most of his career. He's also a father, husband, drummer, and windsurfer. He wants to be a guitar player but he just hasn't got the chops for it.