Remote Debugging in Visual Studio – Part 2

In my previous post i have explained about How to debug an application using Visual Studio Debugger. There is one more way to debug your remote application using a tool called “msvsmon.exe”. The Remote Debugging Monitor (msvsmon.exe) is a small application that Visual Studio connects to for remote debugging and can be found in the location of %Program Files%\Microsoft Visual Studio 11.0\Common7\IDE\Remote Debugger. Remote Debugging involves two way communication between the Visual Studio Debugger and Visual Studio Remote Debugging Monitor(msvsmon.exe). For remote debugging to work, it is important which user runs Visual Studio and also which user runs msvsmon.exe.  To connect to msvsmon, you must run Visual Studio under the same user account as msvsmon. So  you must have a local user account on each computer, and both accounts must have the same user name and password. I have a simple HelloWorld.exe application on my remote machine. To start remote debugging

  • Copy all pdb files on remote machine and launch your application there.
  • Run msvsmon.exe tool on Remote machine by using visual studio command prompt or launch directly from the location.

msvsmonServerName

  • Copy Server name from msvsmon.exe
  • Open application source code in client machine and launch “Attach To Process” window (CNTRL + ALT + P)
  • Paste server name in “Qualifier” textbox and Refresh will shows all the process from Remote machine
  • Attach the HelloWorld.exe project to debug.

Attach We have option to share pdb files from client side. Follow the below steps to debug your application using shared pdb files. Client machine

  • Create a folder with all pdb files that you want to debug.
  • Share the folder to access everyone.

Server Side

  • Open Command Prompt.
  • Change directory to msvsmon.exe location.
  • Set Symbol Path for msvsmon.exe using “set _NT_SYMBOL_PATH command and launch msvsmon.exe

SymbolShare

Next time onwards visual studio will try to  load symbols from shared path also.

Advertisement

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 )

Connecting to %s