Aracılığıyla paylaş


How to: Set Up Remote Debugging

This topic applies to:

Edition

Visual Basic

C#

F#

C++

Web Developer

Express

Topic does not apply Topic does not apply Topic does not apply Topic does not apply Topic does not apply

Pro, Premium, and Ultimate

Topic applies Topic applies Topic applies Topic applies Topic does not apply

To enable remote debugging, you can either:

  • Install the remote debugging components on the remote computer and launch the Remote Debugging Monitor (msvsmon.exe) when you start debugging

    - or -

  • Run the Remote Debugging Monitor remotely from a share.

Running the Remote Debugging Monitor from a file share is the easiest way to enable remote debugging.

When you install Visual Studio on a 64-bit platform, versions of Remote Debugging Monitor for all three architectures are copied to the folder:

InstallPath\Microsoft Visual Studio 10.0\Common7\IDE\Remote Debugger

To install the other remote debugging components, follow the procedure in this topic.

If you share the Remote Debugger directory on the Visual Studio computer, you can run msvsmon.exe on the remote computer. The following debugger scenarios require that you install remote-debugging components on the remote machine:

  • Stepping into a hosted serviced called from a WCF client.

  • Automatically debugging an ASP.NET Web application.

In both cases, manual attach is possible without installing the components on the remote machine.

As an alternative to running from a share, you can install the necessary remote debugging components on the remote computer. This installation provides access to all remote debugging features. When you run the Remote Debugger install on an x86 platform, only the x86 remote debugging components are installed. There is no option to install 64-bit components. If you run it on a 64-bit platform, both x86 and 64-bit components are installed.

To install remote debugging components

  1. The remote debugger is available on the Visual Studio installation DVD.

  2. In Windows Explorer, open the DVD and locate vs/Remote Debugger.

  3. In the vs/Remote Debugger folder, launch the version of Microsoft Visual Studio 2010 Remote Debugger Setup that is appropriate for your platform: rdbgsetup_x86, rdbgsetup_x64, or rdbgsetup_ia64.

  4. Follow the Remote Debugger Setup wizard instructions to complete setup.

    If you prefer, you can install the remote debugging components by copying the files manually. See Remote Debugging Components for a list of required components and their install locations. Visual Studio includes separate versions of Remote Debugging Monitor for 32-bit and 64-bit platforms. If you use Remote Debugger Setup, it will install the correct version of Remote Debugging Monitor automatically. If you copy the files manually, however, you must make sure that you have copied the correct version.

  5. After you have installed the remote debugging components, you must make sure that you have the required permissions to debug a program on the remote computer. See Remote Debugging Permissions for a list of required permissions.

Configuring the Windows Firewall

The Windows Firewall must be configured to enable remote debugging. When you start remote debugging for the first time, Visual Studio performs the necessary configuration on the Visual Studio host computer. When you run the Remote Debugging Monitor on a remote computer for the first time, the Remote Debugging Monitor configures the Windows Firewall on that end.

On Windows XP, this configuration is completely transparent and automatic, but on Windows Vista, the new security model requires that you grant permission before the software can configure the firewall. This permission is granted through the User Account Control dialog box. For a description of the new security model and User Access Control, see The Windows Security Model.

When the Remote Debugging Monitor has to configure the Windows Firewall on the remote computer, the User Access Control dialog box appears on the remote computer. If the remote computer is not visible, you may not realize that the UAC dialog box has appeared on its monitor. In that case, you may mistakenly believe that remote debugging has stopped responding. In reality, the Remote Debugging Monitor is merely waiting for someone to grant UAC permission on the remote computer.

It is highly unlikely that you will ever have to configure the Windows Firewall manually. If you do configure it manually, see How to: Manually Configure the Windows 7 Firewall for Remote Debugging, How to: Manually Configure the Windows Vista Firewall for Remote Debugging, or How to: Manually Configure the Windows XP Firewall for Remote Debugging.

-

Web Server Debugging

To enable Web server debugging on Windows Vista or Windows XP SP2

Starting Remote Debugging

To start remote debugging

  1. Make sure that you have the necessary remote debugging permissions on the remote computer. For more information, see Remote Debugging Permissions.

  2. For remote debugging other than SQL, make sure that you are running the Remote Debugging Monitor on the remote computer. For more information, see How to: Run the Remote Debugging Monitor. When you are debugging SQL, the Remote Debugging Monitor will launch automatically during debugging.

  3. Launch Visual Studio on the debugger host.

    Use Visual Studio to attach to a program that you want to debug on the remote computer or launch a program that you want to debug on the remote computer. For more information, see How to: Attach to a Running Process.

See Also

Tasks

Remote Debugging Errors and Troubleshooting

Concepts

Just-In-Time Debugging

Other Resources

Remote Debugging Setup