Remote Debugging

You can debug a Visual Studio application that has been deployed on a different computer. To do so, you use the Visual Studio remote debugger.

For in-depth instructions on remote debugging, see these topics.

Scenario Link
ASP.NET Remote Debugging ASP.NET Core or Remote Debugging ASP.NET
C# or Visual Basic Remote Debugging a C# or Visual Basic Project
C++ Remote Debugging a C++ Project
Universal Windows Apps (UWP) Debug an Installed App Package
Azure Remote Debugging ASP.NET on Azure
Azure Service Fabric Debug a remote Service Fabric application.

If you just want to download and install the remote debugger and don't need any additional instructions for your scenario, follow the steps in this article.

Download and Install the Remote Tools

  1. On the device or server machine that you want to debug (rather than the machine running Visual Studio), get the correct version of the remote tools.

    Version Link Notes
    Visual Studio 2017 Remote Tools Always download the version matching your device operating system (x86 or x64). For older browsers, use these direct links: Remote Tools (x64) and Remote Tools (x86).
    Visual Studio 2015 Update 3 Remote tools If prompted, join the free Visual Studio Dev Essentials group or you can sign in with a valid Visual Studio subscription. Then reopen the link if necessary.
    Visual Studio 2015 (older) Remote tools If prompted, join the free Visual Studio Dev Essentials group or you can sign in with a valid Visual Studio subscription. Then reopen the link if necessary.
    Visual Studio 2013 Remote tools Download page in Visual Studio 2013 documentation
    Visual Studio 2012 Remote tools Download page in Visual Studio 2012 documentation
  2. On the download page, choose the version of the tools that matches your operating system (x86, x64, or ARM) and download the remote tools.

    Important

    We recommend you install the most recent version of the remote tools that matches your version of Visual Studio. Mismatched versions are not recommended. In addition, you must install the remote tools that have the same architecture as the operating system on which you want to install it. In other words, if you want to debug a 32-bit application on a remote computer running a 64-bit operating system, you must install the 64-bit version of the remote tools on the remote computer.

    Surface 3 switched from ARM to x64 architecture. An ARM version of the remote tools is not available for Visual Studio 2017. For Visual Studio 2015, find the ARM version in the Visual Studio 2015 RTW download.

  3. When you have finished downloading the executable, follow the directions to install the application on the remote computer. Follow the setup instructions.

If you try to copy the remote debugger (msvsmon.exe) to the remote computer and run it, be aware that the Remote Debugger Configuration Wizard (rdbgwiz.exe) is installed only when you download the tools. You may need to use the wizard for configuration later, especially if you want the remote debugger to run as a service. For more information, see (Optional) Configure the remote debugger as a service.

(Optional) To run the remote debugger from a file share

You can find the remote debugger (msvsmon.exe) on a computer with Visual Studio Community, Professional, or Enterprise already installed. For some scenarios, the easiest way to set up remote debugging is to run the remote debugger (msvsmon.exe) from a file share. For usage limitations, see the remote debugger's Help page (Help > Usage in the remote debugger).

  1. Find msvsmon.exe in the directory matching your version of Visual Studio. For Visual Studio 2017:

    Program Files\Microsoft Visual Studio 15.0\Common7\IDE\Remote Debugger\x86\msvsmon.exe

    Program Files\Microsoft Visual Studio 15.0\Common7\IDE\Remote Debugger\x64\msvsmon.exe

  2. Share the Remote Debugger folder on the Visual Studio computer.

  3. On the remote computer, run msvsmon.exe. Follow the setup instructions.

Tip

For command line installation and command line reference, see the Help page for msvsmon.exe by typing msvsmon.exe /? in the command line on the computer with Visual Studio installed (or go to Help > Usage in the remote debugger).

Requirements

Supported Operating Systems

The remote computer must be running one of the following operating systems:

  • Windows 10 (not phone)

  • Windows 8 or 8.1 (not phone)

  • Windows 7 Service Pack 1

  • Windows Server 2012 or Windows Server 2012 R2

  • Windows Server 2008 Service Pack 2, Windows Server 2008 R2 Service Pack 1

Note

Windows Phone requires a USB connection to debug (it does not require the remote tools).

Supported Hardware Configurations

  • 1.6 GHz or faster processor

  • 1 GB of RAM (1.5 GB if running on a virtual machine)

  • 1 GB of available hard disk space

  • 5400-RPM hard drive

  • DirectX 9-capable video card running at 1024 x 768 or higher display resolution

Network configuration

The remote computer and the Visual Studio computer must be connected over a network, workgroup, or homegroup, or else connected directly through an Ethernet cable. Debugging between two computers connected through a proxy is not supported. Debugging over a high latency or low bandwidth connection, such as dialup Internet, or over the Internet across countries is not recommended and may fail or be unacceptably slow.

Set up the remote debugger

You must have administrative permissions on the remote computer.

  1. Locate the Remote Debugger application. (Find msvsmon.exe in the location where it has been installed, or open the Start menu and search for Remote Debugger.)

    If you are running the remote debugger on a remote server, you can right-click the Remote Debugger app and choose Run as administrator (Or, you can run the remote debugger as a service). If you are not running it on a remote server, just start it normally.

  2. When you start the remote tools for the first time (or before you have configured it), the Remote Debugging Configuration dialog box appears.

    RemoteDebuggerConfWizardPage

  3. If the Windows Service API is not installed (which happens only on Windows Server 2008 R2), choose the Install button.

  4. Select the network types you want use the remote tools on. At least one network type must be selected. If the computers are connected through a domain, you must choose the first item. If the computers are connected through a workgroup or homegroup, you need to choose the second or third item as appropriate.

  5. Choose Configure remote debugging to configure the firewall and start the tool.

  6. When configuration is complete, the Remote Debugger window appears.

    RemoteDebuggerWindow

    The remote debugger is now waiting for a connection. Make a note of the server name and port number that is displayed, because this must match the configuration you later use in Visual Studio.

    When you are finished debugging and need to stop the remote debugger, click File > Exit on the window. You can restart it from the Start menu or from the command line:

    <Visual Studio installation directory>\Common7\IDE\Remote Debugger\<x86, x64, or Appx\msvsmon.exe.

Configure the remote debugger

You can change some aspects of the configuration of the remote debugger after you have started it for the first time.

  • If you need to add permissions for other users to connect to the remote debugger, choose Tools > Permissions. You must have administrator privileges to grant or deny permissions.

    Important

    You can run the remote debugger under a user account that differs from the user account you are using on the Visual Studio computer, but you must add the different user account to the remote debugger's permissions.

    Alternatively, you can start the remote debugger from the command line with the /allow <username> parameter: msvsmon /allow <username@computer>.

  • If you need to change the Authentication mode or the port number, or specify a timeout value for the remote tools: choose Tools > Options.

    For a listing of the port numbers used by default, see Remote Debugger Port Assignments.

    Warning

    You can choose to run the remote tools in No Authentication mode, but this mode is strongly discouraged. There is no network security when you run in this mode. Choose the No Authentication mode only if you are sure that the network is not at risk from malicious or hostile traffic.

(Optional) Configure the remote debugger as a service

For debugging in ASP.NET and other server environments, you must either run the remote debugger as an Administrator or, if you want it always running, run the remote debugger as a service.

If you want to configure the remote debugger as a service, follow these steps.

  1. Find the Remote Debugger Configuration Wizard (rdbgwiz.exe). (This is a separate application from the Remote Debugger.) It is available only when you install the remote tools. It is not installed with Visual Studio.

  2. Start running the configuration wizard. When the first page comes up, click Next.

  3. Check the Run the Visual Studio 2015 Remote Debugger as a service checkbox.

  4. Add the name of the user account and password.

    You may need to add the Log on as a service user right to this account (Find Local Security Policy (secpol.msc) in the Start page or window (or type secpol at a command prompt). When the window appears, double-click User Rights Assignment, then find Log on as a service in the right pane. Double-click it. Add the user account to the Properties window and click OK). Click Next.

  5. Select the type of network that you want the remote tools to communicate with. At least one network type must be selected. If the computers are connected through a domain, you should choose the first item. If the computers are connected through a workgroup or homegroup, you should choose the second or third items. Click Next.

  6. If the service can be started, you will see You have successfully completed the Visual Studio Remote Debugger Configuration Wizard. If the service cannot be started, you will see Failed to complete the Visual Studio Remote Debugger Configuration Wizard. The page also gives some tips to follow to get the service to start.

  7. Click Finish.

    At this point the remote debugger is running as a service. You can verify this by going to Control Panel > Services and looking for Visual Studio 2015 Remote Debugger.

    You can stop and start the remote debugger service from Control Panel > Services.

Set Up Debugging with Remote Symbols

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 much better when you use local symbols. If you must use remote symbols, you need to tell the remote debugging monitor to look for symbols on the remote machine.

Starting in Visual Studio 2013 Update 2, you can use the following msvsmon command-line switch to use remote symbols for managed code: Msvsmon /FallbackLoadRemoteManagedPdbs

For more information, please see the remote debugging help (press F1 in the remote debugger window, or click Help > Usage). You can find more information at .NET Remote Symbol Loading Changes in Visual Studio 2012 and 2013

See Also

Debugger Feature Tour
Configure the Windows Firewall for Remote Debugging
Remote Debugger Port Assignments
Remote Debugging ASP.NET Core on a Remote IIS Computer
Remote Debugging Errors and Troubleshooting