Export (0) Print
Expand All

Remote Debugging of a Project Built Locally

You may want to take a project that is built locally and run the executable on a remote machine for debugging. This topic explains how to change your local project settings to run the executable on a remote machine.

These examples assume that remote debugging has already been set up on the remote machine. If you need to install remote debugging on the remote machine, see Remote Debugging Setup.

Visual C++

This example assumes that you have an MFC project mymfc built on machine local1. You want to run the application mymfc.exe on machine remote1 and debug using the Visual Studio .NET debugger on machine local1.

To prepare the remote machine

  1. Start up msvcmon on remote1. (See Remote Debugging with the Remote Debug Monitor.)
  2. Copy the executable mymfc.exe to a location on the remote machine. (For this example, c:\temp\myexe.exe.)

To prepare the local machine

  1. From the Project menu, choose Properties.
  2. In the mymfc Properties dialog box, open the Configuration Properties folder and select the Debugging category.
  3. Change Connection from Local to Remote Via Pipe (Native Only).
  4. Change Debugger Type from Auto to Native Only.
  5. For the Remote Machine setting, enter remote1.
  6. For the Remote Command setting, enter c:\temp\myexe.exe.
  7. Leave the Command setting as is. During remote debugging, the debugger will ignore this and use the Remote Command setting.
  8. Set the Symbol Path to a location on local1 where the debug symbols can be found. Native remote debugging cannot use symbols from a remote machine, so you must give a local location.
  9. Click OK.
  10. From the Debug menu, choose Start and begin debugging.

Visual C#

This example assumes that you have a Windows Application project mywin4m built on machine local1. You want to run the application mywin4m.exe on machine remote1 and debug using the Visual Studio .NET debugger on machine local1.

To prepare the remote machine

  • Copy the executable mywin4m.exe to a location on the remote machine. (For this example, c:\temp\ mywin4m.exe.)

To prepare the local machine

  1. From the Project menu, choose mywin4m Properties.
  2. In the mywin4m Properties dialog box, open the Configuration Properties folder and select the Debugging category.
  3. Change the Debugger Mode setting from Project to Program.
  4. For the Start Application setting, enter c:\temp\mywin4m.exe.
  5. Set Enable Remote Debugging to True.
  6. For Remote Debug Machine setting, enter remote1.
  7. If you want to do mixed-mode debugging of managed and unmanaged code, set Enable Unmanaged Debugging to True.
  8. Click OK.
  9. From the Debug menu, choose Start and begin debugging.

Visual Basic

This example assumes that you have a Windows Application project mywin4m built on machine local1. You want to run the application mywin4m.exe on machine remote1 and debug using the Visual Studio .NET debugger on machine local1.

To prepare the remote machine

  • Copy the executable mywin4m.exe to a location on the remote machine. (For this example, c:\temp\ mywin4m.exe.)

To prepare the local machine

  1. From the Project menu, choose mywin4m Properties.
  2. In the mywin4m Properties dialog box, open the Configuration Properties folder and select the Debugging category.
  3. Select Start external program and enter c:\temp\mywin4m.exe in the adjacent textbox.
  4. In the Command line arguments box, enter any arguments you want to pass to the remote machine.
  5. Select Use remote machine and enter remote1 in the adjacent textbox.
  6. Under Debuggers, select Unmanaged code debugging if you want to do mixed-mode debugging of managed and unmanaged code.
  7. Click OK.
  8. From the Debug menu, choose Start and begin debugging.

See Also

Remote Debugging Setup

Show:
© 2014 Microsoft