|
2 | 2 | title: "Remote Debug a C++ Project | Microsoft Docs"
|
3 | 3 | description: Learn how to debug a Visual Studio C++ application from a remote computer by following these step-by-step instructions.
|
4 | 4 | ms.custom: "remotedebugging"
|
5 |
| -ms.date: "11/11/2021" |
| 5 | +ms.date: "08/19/2022" |
6 | 6 | ms.topic: "conceptual"
|
7 | 7 | dev_langs:
|
8 | 8 | - "C++"
|
@@ -52,50 +52,52 @@ The remote debugger is supported on Windows 7 and newer and versions of Windows
|
52 | 52 | > If you need to add permissions for additional users, change the authentication mode, or port number for the remote debugger, see [Configure the remote debugger](../debugger/remote-debugging.md#configure_msvsmon).
|
53 | 53 |
|
54 | 54 | ## <a name="remote_cplusplus"></a> Remote debug a C++ project
|
55 |
| - In the following procedure, the name and path of the project is C:\remotetemp\MyMfc, and the name of the remote computer is **MJO-DL**. |
| 55 | + In the following procedure, the path of the project is C:\remotetemp, and the name of the remote computer is **MySurface**. |
56 | 56 |
|
57 |
| -1. Create an MFC application named **mymfc.** |
| 57 | +1. Create a C++ Console application named **CppConsoleApp** |
58 | 58 |
|
59 |
| -2. Set a breakpoint somewhere in the application that is easily reached, for example in **MainFrm.cpp**, at the start of `CMainFrame::OnCreate`. |
| 59 | +2. Set a breakpoint somewhere in the application that is easily reached, for example in **CppConsoleApp.cpp**, in the `main` function. |
60 | 60 |
|
61 | 61 | 3. In Solution Explorer, right-click on the project and select **Properties**. Open the **Debugging** tab.
|
62 | 62 |
|
63 | 63 | 4. Set the **Debugger to launch** to **Remote Windows Debugger**.
|
64 | 64 |
|
65 |
| -  |
| 65 | +  |
66 | 66 |
|
67 | 67 | 5. Make the following changes to the properties:
|
68 | 68 |
|
69 | 69 | |Setting|Value|
|
70 | 70 | |-|-|
|
71 |
| - |Remote Command|C:\remotetemp\mymfc.exe| |
| 71 | + |Remote Command|C:\remotetemp\CppConsoleApp.exe| |
72 | 72 | |Working Directory|C:\remotetemp|
|
73 |
| - |Remote Server Name|MJO-DL:*portnumber*| |
| 73 | + |Remote Server Name|MySurface:*portnumber*| |
74 | 74 | |Connection|Remote with Windows Authentication|
|
75 | 75 | |Debugger Type|Native Only|
|
76 |
| - |Deployment Directory|C:\remotetemp.| |
77 |
| - |Additional Files to Deploy|C:\data\mymfcdata.txt.| |
| 76 | + |Deployment Directory|C:\remotetemp| |
| 77 | + |Additional Files to Deploy|$(ProjectDir)\data| |
78 | 78 |
|
79 |
| - If you deploy additional files (optional), the folder must exist on both machines. |
| 79 | + If you deploy additional folders, and want all the files in a folder deployed to the same folder, specify a folder name. |
| 80 | + |
| 81 | + For more information on the properties, see [Project settings for a C++ Debug configuration](../debugger/project-settings-for-a-cpp-debug-configuration.md). |
80 | 82 |
|
81 | 83 | 6. In Solution Explorer, right-click the solution and choose **Configuration Manager**.
|
82 | 84 |
|
83 | 85 | 7. For the **Debug** configuration, select the **Deploy** check box.
|
84 | 86 |
|
85 |
| -  |
| 87 | +  |
86 | 88 |
|
87 | 89 | 8. Start debugging (**Debug > Start Debugging**, or **F5**).
|
88 | 90 |
|
89 | 91 | 9. The executable is automatically deployed to the remote computer.
|
90 | 92 |
|
91 | 93 | 10. If prompted, enter network credentials to connect to the remote machine.
|
92 | 94 |
|
93 |
| - The required credentials are specific to your network's security configuration. For example, on a domain computer, you might choose a security certificate or enter your domain name and password. On a non-domain machine, you might enter the machine name and a valid user account name, like < strong> MJO-DL\ [email protected]</ strong>, along with the correct password. |
| 95 | + The required credentials are specific to your network's security configuration. For example, on a domain computer, you might choose a security certificate or enter your domain name and password. On a non-domain machine, you might enter the machine name and a valid user account name, like < strong> MySurface\ [email protected]</ strong>, along with the correct password. |
94 | 96 |
|
95 | 97 | 11. On the Visual Studio computer, you should see that execution is stopped at the breakpoint.
|
96 | 98 |
|
97 | 99 | > [!TIP]
|
98 |
| - > Alternatively, you can deploy the files as a separate step. In the **Solution Explorer,** right-click the **mymfc** node and then choose **Deploy**. |
| 100 | + > Alternatively, you can deploy the files as a separate step. In the **Solution Explorer,** right-click the project node and then choose **Deploy**. |
99 | 101 |
|
100 | 102 | If you have non-code files that are required by the application, you can specify them in a semicolon delimited list in **Additional Files to Deploy** on the **Remote Windows Debugger** page.
|
101 | 103 |
|
|
0 commit comments