| title | Remote Debug a C++ Project | |||||
|---|---|---|---|---|---|---|
| description | Debug a Visual Studio C++ application from a remote computer, install and run remote tools, configure your project to connect, and deploy and run your app. | |||||
| ms.date | 12/5/2025 | |||||
| ms.topic | how-to | |||||
| dev_langs |
|
|||||
| helpviewer_keywords |
|
|||||
| author | mikejo5000 | |||||
| ms.author | mikejo | |||||
| ms.subservice | debug-diagnostics |
To debug a Visual Studio application on a different computer, install and run the remote tools on the computer where you deploy your app, configure your project to connect to the remote computer from Visual Studio, and then deploy and run your app.
For information about remote debugging Universal Windows Apps (UWP), see Debug an Installed App Package.
The remote debugger is supported on Windows 7 and newer and versions of Windows Server starting with Windows Server 2008 Service Pack 2. For a complete list of requirements, see Requirements.
Note
Debugging between two computers connected through a proxy isn't supported. Debugging over a high latency or low bandwidth connection, such as dialup Internet, or over the internet across countries/regions isn't recommended and might fail or be unacceptably slow.
[!INCLUDE remote-debugger-download]
Tip
In some scenarios, it can be most efficient to run the remote debugger from a file share. For more information, see Run the remote debugger from a file share.
After you install the remote debugger, follow these steps.
[!INCLUDE remote-debugger-configuration]
Note
If you need to add permissions for more users, change the authentication mode, or port number for the remote debugger, see Configure the remote debugger.
In the following procedure, the path of the project is C:\remotetemp, and the name of the remote computer is MySurface.
-
Create a C++ Console application named CppConsoleApp
-
Set a breakpoint somewhere in the application that is easily reached, for example in CppConsoleApp.cpp, in the
mainfunction. -
In Solution Explorer, right-click on the project and select Properties. Open the Debugging tab.
-
Set the Debugger to launch to Remote Windows Debugger.
-
Make the following changes to the properties:
Setting Value Remote Command C:\remotetemp\CppConsoleApp.exe Working Directory C:\remotetemp Remote Server Name MySurface:portnumber Connection Remote with Windows Authentication Debugger Type Native Only Deployment Directory C:\remotetemp Additional Files to Deploy $(ProjectDir)\data If you deploy other folders, and want all the files in a folder deployed to the same folder, specify a folder name.
For more information on the properties, see Project settings for a C++ Debug configuration.
-
In Solution Explorer, right-click the solution and choose Configuration Manager.
-
For the Debug configuration, select the Deploy check box.
-
Start debugging (Debug > Start Debugging, or F5).
-
The executable is automatically deployed to the remote computer.
-
If prompted, enter network credentials to connect to the remote machine.
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 nondomain machine, you might enter the machine name and a valid user account name, like MySurface\name@something.com, along with the correct password.
-
On the Visual Studio computer, you should see that execution is stopped at the breakpoint.
[!TIP] Alternatively, you can deploy the files as a separate step. In the Solution Explorer, right-click the project node and then choose Deploy.
If you have noncode files that are required by the application, you can specify them in a semicolon delimited list in Additional Files to Deploy on the Debugger properties page with Remote Windows Debugger selected.
Alternatively, you can include the files in your project, and set the Content property to Yes in the Properties page for each file. These files are copied to the Deployment Directory specified on the Debugger properties page with Remote Windows Debugger selected. You can also change the Item Type to Copy File and specify other properties there if you need the files to be copied to a subfolder of the Deployment Directory.
You should be able to debug your code with the symbols you generate on the Visual Studio computer. The performance of the remote debugger is better when you use local symbols.
If you must use remote symbols, you need to specify the remote symbols in Visual Studio by adding a Windows file share to the symbol search path.
:::moniker range="visualstudio"
Open the Tools > Options pane, expand the All Settings > Debugging > General > Symbols > Search Locations section, and update the Symbol file (.pdb) locations list. Adjust other settings as needed.
:::moniker-end :::moniker range="<=vs-2022"
Open the Tools > Options dialog, expand the Debugging > General > Symbols section, and update the Symbol file (.pdb) search locations list. Adjust other settings as needed.
:::moniker-end


