Visual Studio supports debugging a program on a remote machine, and after simple setup, it's as easy as debugging local code.
The first step : Copy the Remote Debugger folder in the VS tool to the target machine. The approximate directory should be: D:\Program Files (x86) \microsoft Visual Studio ***\common7\ide\remote Debugger, or you can find a shortcut to it from the Start menu, such as:
The second step : Open the Remote Debugger folder on the server, if it is 32-bit run X86 inside the msvsmon.exe, if it is 64-bit run X64 inside the msvsmon.exe, after the boot can see the monitoring interface. By default, users with administrator privileges on the remote server can connect to the debug server and, if required, allow other users (such as users running vs locally) to be set through the tools-as permission. You can see help, usage, and a simple description of debugging.
Step three : Use the VS tool to open your program source code, use the shortcut key CTRL + ALT + P to open the additional process form, qualifier enter the remote server address, select the process to debug.
Note programs on the remote server need to have symbol files (PDB files), which are typically placed in the application's directory.
Visual Studio Remote Debugging