Remote Debugging

Debugging your code using Visual Studio is an easy and useful thing to do, until you have to do it remotely, then its not so obvious what is required. After a lot of trial and error working around network access and firewalls etc these are the steps I took to get remote debugging working (using Visual Studio 2008).

For brevity the machine running Visual Studio shall be referred to as the source and the machine running the application shall be referred to as the target.

On both the source and target:

  • The ‘Sharing & Security model for local account’ should be set to ‘Classic – Local users authenticate as themselves’. This can be found under Control Panel/Administrative Tools/Local Policies/Security Options/Network Access.

On the source machine:

  • Run Visual Studio as the same username/password as you the target is running as, i.e. if the target is running as admin/password then Visual Studio needs to be  running as a user name of admin with the password ‘password’.
  • Build the source code in Debug.
  • Copy the dll’s and pdb’s to the application folder on the target.
On the target machine:
  • Disable the firewall if neccessary.
  • Run the Remote Debugger and set the options to ‘Windows Authentication’. The remote debugger can be found in the Visual Studio install location at Microsoft Visual Studio 9.0\Common7\IDE\Remove Debugger\x86.
On the source machine:
  • In Visual Studio select Debug/Attach to Process.
  • In the ‘Qualifier’ dropdown type the target machine name.
  • Select the application process name to debug.
And thats it, this may be a bit specific to the network environment I was working in but this should work in most situations when trying to remote debug across a network.
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s