Remote Debugging

Every so often, on days like today, I need to debug on a machine where I don't have a debugger installed. There are a few options in this case, but one of the most convenient of these is to use Visual Studio's remote debugging facility.

The procedure is pretty convenient with Visual Studio 2010, since all you have to do is:

  1. Log into the machine you wish to debug on (you can use TS). In my case let's use msl-1440087.
  2. Make sure you can navigate to a share on the machine with the debugger installed (galaxy-dev for example).
  3. Run the right version of msvsmon.exe from the share, for example, the 32 bit version, as follows:
    > "\\galaxy-dev\c$\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\Remote Debugger\x86\msvsmon.exe"
  4. Go back to the machine that the debugger is installed on (galaxy-dev) and choose 'Tools -> Attach To Process...'
  5. Enter the machine name where you started msvsmon.exe in the Qualifier section.
  6. Select the process you wish to debug,
  7. Choose the type of debugging - Native or Managed etc.
  8. Select 'Attach'.

Debug as you usually would. Thanks to Gregg for writing a blog post reminding me how to do this. You might also be interested in his post about Remote Debugging without domain accounts.