Summary of remote debugging methods in VS2010

Suppose there are two PCs, A and B.

VS2010 is installed on the A machine, which means that the A machine is the machine used for development.

Machine B is the machine used by the program to run and deploy, and its IP is: 192.168.1.129 (LAN IP)

Note: If the B machine is an external network IP, the following method is still suitable, but there may be an error that it cannot be attached to the process when it is suitable.

If you get the error cannot attach to process, cannot connect to device. Follow step 13 to set it up.

 

1. Find the Remote Debugger folder according to the vs2010 installation directory. As shown below:

 

Summary of remote debugging methods in VS2010

 

 

2. Copy the C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\Remote Debugger directory to the B machine

3. Run the msvsmon.exe file under Remote Debugger\x86 in machine B as shown below: (Note that msvsmon.exe is run as an administrator program)

Summary of remote debugging methods in VS2010
 

 

4. Select the Options menu item in Tools in the above figure, as shown below:

Summary of remote debugging methods in VS2010



Summary of remote debugging methods in VS2010

 

5. In the pop-up dialog box, set as follows, as shown in the figure below:


Summary of remote debugging methods in VS2010

 

6. After the setting is completed, click the OK button 


Summary of remote debugging methods in VS2010

 

At this point, the machine B that needs to be debugged has been set up.

 

 

 

An example is given below to demonstrate how to debug a program running in machine B on machine A.

 

7. Run test.exe on machine B as shown below:


Summary of remote debugging methods in VS2010

 



Summary of remote debugging methods in VS2010

 

 

8. Open the source code corresponding to test.exe on machine A (note that the source code must be consistent with test.exe, this article only gives the debugging method, the code in the example has no logic), as shown below:


Summary of remote debugging methods in VS2010
 

 

9. Select the Attach to Process submenu item in the Debug menu in 8, as shown below:

Summary of remote debugging methods in VS2010

 

 

The following dialog box pops up:

Summary of remote debugging methods in VS2010
 

 

10. In Transport, select: Remote (Native only with no authentication) option, and enter in Qualifier: 192.168.1.129. As shown below:

Summary of remote debugging methods in VS2010
 

 

11. Click the Refresh button on the basis of 10, and you can see the list of processes on the B machine. Find the process test.exe we need to debug in the process list and select it
Summary of remote debugging methods in VS2010
 

12. After selecting the process to be debugged, click Attach to debug the program on machine B.

Summary of remote debugging methods in VS2010

 

13. Cannot attach to the process solution:
(1) From the "Start" menu, select "Control Panel".
(2) Double-click "Administrative Tools" in "Control Panel".
(3) Double-click "Local Security Policy" in the "Administrative Tools" window.
(4) In the "Local Security Policy" window, select "Local Policy".

(5) In the "Policy" column, double-click "Network Access: Sharing and Security Model for Local Accounts".
(6) In the "Network Access: Sharing and Security Model for Local Accounts" dialog box, change the local security setting to "Legacy" and click "OK".
(7) Open the service TerminalService

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325308917&siteId=291194637