Surprisingly, it’s been quite pleasant.  I have tried Remote Debugging with VS.NET 2003, and I didn’t have much luck with it. However, last week there was a scenario where I desperately needed it and given that we have upgraded to VS 2008, I thought I should give it another try. There is two steps I had to perform to get this to work correctly:

  1. Configure your client machine using the Remote Debugger Configuration Wizard.
  2. Copy the Remote Debugger server components to the remote machine

That’s it.  Ok. I didn’t give you much here, so here is some more detail.

To run the Remote Debugger Configuration Wizard go to:

Start -> Program -> Microsoft Visual Studio 2008 -> Visual Studio Tools -> Visual Studio 2008 Remote Debugger Configuration Wizard

The wizard will begin and you will be brought to this screen:

 

 

 

 

 

 

 

 

 

This screen is basically asking if you want to run the remote debugger as a Windows Service. For me, I didn’t check the box to run as a service and it’s probably not even necessary. There is nothing much else to do but to click Next until the wizard completes. At the end it will tell you that all the necessary ports (most likely TCP) were opened and ready to connect to remote machines.

To run the server components on the remote machine, you need to copy the contents of this folder to the remote machine.

C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\Remote Debugger\x86

Once copied to the remote machine you will just have to run the msvsmon.exe program. The main window would look like this when it’s ready to accept incoming connections:

image

 

 

 

 

 

Play close attention to the server name listed in the entry. This is the name you will need to enter into the Qualifier field in the Debug -> Attach to Process screen inside Visual Studio when you want to begin the debugging process.

image

 

 

 

 

 

 

 

 

Remember to set your breakpoint first and attach to the process you want on the remote machine. The process you will want to debug should be listed in the Available Processes list.

One thing to watch out for is that in my setup, my username and password on my client machine and my remote machine were kept in sync. This way I don’t run into any unexpected access/permissions issues when connecting to the remote machine. I would also note that I was an Administrator on both machines so this would rule out any permission issues.

Let me know if you found this helpful. I do appreciate how the Visual Studio tools team simplified this process to it is as easy as following the 2 steps I listed above.

Until next time…

Happy coding!

kick it on DotNetKicks.com