Share via


Remote Debugging of a Project Built Locally

You might want to debug a project that is built locally and then run the executable on a remote computer. This topic explains how to change your local project settings to run the executable on a remote computer.

These examples assume that the Visual Studio Remote Debugging Monitor has already been set up on the remote computer. See Remote Debugging Setup.

Visual C++

The procedure shown here assumes that you have an MFC project, mymfc, built on computer local1. You want to run the application mymfc.exe on computer remote1 in the c:\remotetemp folder, and then debug by using the Visual Studio debugger on computer local1. Additionally, you want to copy the file c:\localfolder\data.txt to the remote computer.

Note

The dialog boxes and menu commands you see might differ from those described in Help depending on your active settings or software edition. To change your settings, select Import and Export Settings on the Tools menu. For more information, see Customizing Development Settings.

To prepare the remote computer

To prepare the local computer

  1. On the Project menu, select Properties.

  2. In the mymfc Property Pages dialog box, expand the Configuration Properties node and click Debugging.

  3. Change Debugger to launch to Remote Windows Debugger.

  4. For the Remote Command setting, type c:\remotetemp\mymfc.exe.

  5. Change Working Directory to c:\remotetemp.

  6. For the Remote Server Name setting, type remote1.

  7. Change Connection to Remote with Windows Authentication.

  8. Change Debugger Type from Auto to Native Only, because you know you are debugging native code.

  9. Change Deployment Directory to c:\remotetemp.

  10. Change Additional Files to Deploy to c:\localfolder\data.txt.

  11. Click OK.

  12. On the toolbar, open the Solution Configuration drop-down menu, and choose Configuration Manager.

  13. For the Debug configuration, select the Deploy check box.

  14. On the Debug menu, select Start and begin debugging.

    Tip

    The Debug command automatically deploys (copies) the project output and additional files to the remote computer. You can deploy the files as a separate step. In Solution Explorer, open the shortcut menu for mymfc, and then choose Deploy.

Visual C#/Visual Basic

The procedure shown here assumes that you have a Windows Application project, mywin4m, built on computer local1. You want to run the application mywin4m.exe on computer remote1, and then debug by using the Visual Studio debugger on computer local1.

To prepare the remote computer

  • Copy the executable mywin4m.exe to a location on the remote computer.

To prepare the local computer

  1. On the File menu, point to Open and click Project/Solution.

  2. In the Open Project dialog box, find mywin4m.exe on the local or remote computer.

  3. Select mywin4m.exe, and then click OK.

  4. In Solution Explorer, right-click the project, and then click Properties.

  5. On the mywin4m properties page, click Debug.

  6. In the Working directory text box, type c:\temp.

  7. In the Machine name text box, type remote1.

  8. (Optional) Under Debugger Type, select Mixed mode to explicitly enable debugging of both managed and unmanaged code.

  9. Start the Remote Debugging Monitor on the remote computer, and set the remote debugging mode to either Windows Authentication mode or No Authentication mode.

    For more information, see How to: Run the Remote Debugging Monitor.

  10. On the Debug menu, select Start and begin debugging.

See Also

Other Resources

Remote Debugging Setup

Specify Symbol (.pdb) and Source Files in the Visual Studio Debugger