VS remote debugging

The remote debugging function of VS allows developers to debug programs remotely, which is very powerful. Now make a simple record of its use steps.

1. The remote debugger tool needs to be installed on the remote computer. This tool can be found in the VS installation directory. For example, I use the VS2015 version and the directory is: c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\Remote Debugger\.

There are three folders in this directory. X86 is used for 32-bit program debugging, and X64 is used for 64-bit program debugging. Here you need to decide which version to use according to the version of the adjusted program.

2. You can copy the entire directory to any directory on the remote computer, find the msvsmon.exe program in the X86/X64 directory, and run it with administrator privileges:

< img alt="Share a picture" src="/wp-content/uploads/images/os/windows/1626798003435.png" >

3. After running, you can simply configure it:

Share a picture

You can Set to use Windos authentication to log in, or you can choose no authentication, and check “Allow any user to debug” (I generally use this mode). Click “OK”. Wait for the development machine to connect and debug;

4. Run the program that needs to be debugged on the remote computer;

5. On the development machine, open the VS tool, the project code is the program code that needs to be debugged Unanimous. Note that if the program is inconsistent, the debugger will report an inconsistent exception.

6. Select “Debug” -> “Attach to Process” in the VS menu bar;

7. Click “Find” and select the remote computer;

Share a picture

8. Find the process that needs to be debugged from the available processes, and click “Attach” to start debugging. Note that when debugging, don’t forget to add breakpoints.

Some points to note: The remote debugger is best run by the administrator, otherwise it will report an exception that refuses to debug; add breakpoints at key codes before debugging; executable programs The version and debugging code are the same version of the program.

Leave a Comment

Your email address will not be published.