Visual Studio Remote Desktop



This project is a full remote desktop application which is very similar to Microsoft remote desktop that was written using VS2010 and C# and consists of two fully working modules that make up the client server components needed for a remote desktop. Visual Studio Code Remote Development allows you to use a container, remote machine, or the Windows Subsystem for Linux (WSL) as a full-featured development environment. In Remote Desktop Connection, type the name of the PC you want to connect to (from Step 1), and then select Connect. On your Windows, Android, or iOS device: Open the Remote Desktop app (available for free from Microsoft Store, Google Play, and the Mac App Store), and add the name of the PC that you want to connect to (from Step 1).

Download Visual Studio Community, Professional, and Enterprise. Try Visual Studio IDE, Code or Mac for free today.

-->

You can use Visual Studio to run, debug, profile, and test a Universal Windows Platform (UWP) app on another computer or device. Running the UWP app on a remote machine is especially helpful when the Visual Studio computer does not support UWP-specific functionality like touch, geo-location, or physical orientation.

Prerequisites

To debug a UWP app on a remote device from Visual Studio:

  • The Visual Studio project must be configured for remote debugging.
  • The remote machine and the Visual Studio computer must be connected over a network, or connected directly through a USB or Ethernet cable. Debugging over the internet is not supported.
  • You must turn on developer mode on both the Visual Studio computer and the remote machine.
  • Remote computers must be running the Remote Tools for Visual Studio.
    • Some Windows 10 versions start and run the remote tools automatically. Otherwise, install and run the Remote Tools for Visual Studio.
    • Windows Mobile 10 devices don't require or support the remote tools.

Configure a Visual Studio project for remote debugging

You use the project Properties to specify the remote device to connect to. The settings differ depending on the programming language.

Caution

By default, the property page sets Universal (Unencrypted Protocol) as the Authentication Type for Windows 10 remote connections. You may need to set No Authentication to connect to the remote debugger. Universal (Unencrypted Protocol) and No Authentication protocols have no network security, so data passed between the development and remote machines is vulnerable. Choose these authentication types only for trusted networks that you are sure are not at risk from malicious or hostile traffic.

If you choose Windows Authentication for the Authentication Type, you will need to sign in to the remote machine when debugging. The remote debugger must also be running under Windows Authentication mode, with the same user account as on the Visual Studio machine.

Configure a C# or Visual Basic project for remote debugging

  1. Select the C# or Visual Basic project in Visual Studio Solution Explorer and select the Properties icon, press Alt+Enter, or right-click and choose Properties.

  2. Select the Debug tab.

  3. Under Target device, select Remote Machine for a remote computer, or Device for a direct-connected Windows Mobile 10 device.

  4. For a remote machine, enter the network name or IP address in the Remote machine field, or select Find to search for the device in the Remote Connections dialog box.

Configure a C++ project for remote debugging

  1. Select the C++ project in Visual Studio Solution Explorer and select the Properties icon, press Alt+Enter, or right-click and choose Properties.

  2. Select the Debugging tab.

  3. Under Debugger to launch, select Remote Machine for a remote computer, or Device for a direct-connected Windows Mobile 10 device.

  4. For a remote machine, enter or select the network name or IP address in the Machine Name field, or drop down and select Locate to search for the device in the Remote Connections dialog box.

Use the Remote Connections dialog box

In the Remote Connections dialog box, you can search for a specific remote computer name or IP address, or auto-detect connections by selecting the rounded-arrow refresh icon. The dialog searches only devices on the local subnet that are currently running the remote debugger. Not all devices can be detected in the Remote Connections dialog box.

Tip

If you can't connect to a remote device by name, try using its IP address. To determine the IP address, on the remote device, enter ipconfig in a command window. The IP address appears as IPv4 Address.

Download and install the Remote Tools for Visual Studio

For Visual Studio to debug apps on a remote computer, the remote computer must be running the Remote Tools for Visual Studio.

  • Windows Mobile 10 devices do not require or support the remote tools.
  • Windows 10 PCs running Creator's Update (version 1703) and later, Windows 10 Xbox, IoT, and HoloLens devices install the remote tools automatically when you deploy the app.
  • On pre-Creator's Update Windows 10 PCs, you must manually download, install, and be running the remote tools on the remote computer before you start debugging.

To download and install the remote tools:

On the remote device or server that you want to debug on, rather than the Visual Studio machine, download and install the correct version of the remote tools from the links in the following table.

  • Download the most recent remote tools for your version of Visual Studio. The latest remote tools version is compatible with earlier Visual Studio versions, but earlier remote tools versions aren't compatible with later Visual Studio versions. (For example, if you are using Visual Studio 2017, download the latest update of the remote tools for Visual Studio 2017. In this scenario, do not download the remote tools for Visual Studio 2019.)
  • Download the remote tools with the same architecture as the machine you're installing them on. For example, if you want to debug a 32-bit app on a remote computer running a 64-bit operating system, install the 64-bit remote tools.
VersionLinkNotes
Visual Studio 2019Remote toolsCompatible with all Visual Studio 2019 versions. Download the version matching your device operating system (x86, x64, or ARM64). On Windows Server, see Unblock the file download for help downloading the remote tools.
Visual Studio 2017Remote toolsCompatible with all Visual Studio 2017 versions. Download the version matching your device operating system (x86, x64, or ARM64). On Windows Server, see Unblock the file download for help downloading the remote tools.
Visual Studio 2015Remote toolsRemote tools for Visual Studio 2015 are available from My.VisualStudio.com. If prompted, join the free Visual Studio Dev Essentials program, or sign in with your Visual Studio subscription ID. On Windows Server, see Unblock the file download for help downloading the remote tools.
Visual Studio 2013Remote toolsDownload page in Visual Studio 2013 documentation
Visual Studio 2012Remote toolsDownload page in Visual Studio 2012 documentation
VersionLinkNotes
Visual Studio 2017Remote toolsCompatible with all Visual Studio 2017 versions. Download the version matching your device operating system (x86, x64, or ARM64). On Windows Server, see Unblock the file download for help downloading the remote tools. For the most recent version of the remote tools, open the Visual Studio 2019 doc.
Visual Studio 2015Remote toolsRemote tools for Visual Studio 2015 are available from My.VisualStudio.com. If prompted, join the free Visual Studio Dev Essentials program, or sign in with your Visual Studio subscription ID. On Windows Server, see Unblock the file download for help downloading the remote tools.
Visual Studio 2013Remote toolsDownload page in Visual Studio 2013 documentation
Visual Studio 2012Remote toolsDownload page in Visual Studio 2012 documentation

You can run the remote debugger by copying msvsmon.exe to the remote computer, rather than installing the remote tools. However, the Remote Debugger Configuration Wizard (rdbgwiz.exe) is available only when you install the remote tools. You may need to use the wizard for configuration if you want to run the remote debugger as a service. For more information, see (Optional) Configure the remote debugger as a service.

Note

  • To debug Windows 10 apps on ARM devices, use ARM64, which is available with the latest version of the remote tools.
  • To debug Windows 10 apps on Windows RT devices, use ARM, which is available only in the Visual Studio 2015 remote tools download.

Configure the remote tools

Visual Studio Remote Desktop
  1. On the remote computer, find and start the Remote Debugger from the Start menu.

    If you don't have administrative permissions on the remote computer, right-click the Remote Debugger app and select Run as administrator. Otherwise, just start it normally.

    If you are planning to attach to a process which is running as an administrator, or is running under a different user account (such as IIS), right-click the Remote Debugger app and select Run as administrator. For more information, see Run the remote debugger as an administrator.

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

  3. If the Windows Web Services API is not installed, which happens only on Windows Server 2008 R2, select the Install button.

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

  5. Select Configure remote debugging to configure the firewall and start the remote debugger.

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

    The remote debugger is now waiting for a connection. Use the server name and port number shown to set the remote connection configuration in Visual Studio.

To stop the remote debugger, select File > Exit. You can restart it from the Start menu, or from the command line:

Debug UWP apps remotely

Remote debugging works the same as local debugging.

  1. On pre-Creator's Update versions of Windows 10, make sure the Remote Debugging Monitor (msvsmon.exe) is running on the remote device.

  2. On the Visual Studio computer, make sure the correct debugging target (Remote Machine or Device) appears next to the green arrow on the toolbar.

  3. Start debugging by selecting Debug > Start Debugging, pressing F5, or selecting the green arrow on the toolbar.

    The project recompiles, then deploys and starts on the remote device. The debugger suspends execution at breakpoints, and you can step into, over, and out of code.

  4. If necessary, select Debug > Stop Debugging or press Shift+F5 to stop debugging and close the remote app.

See also

Visual Studio Remote Desktop-->

To debug a Visual Studio application that has been deployed on a different computer, install and run the remote tools on the computer where you deployed your app, configure your project to connect to the remote computer from Visual Studio, and then run your app.

For information about remote debugging Universal Windows Apps (UWP), see Debug an Installed App Package.

Requirements

The remote debugger is supported on Windows 7 and newer (not phone) 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 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.

Download and Install the remote tools

On the remote device or server that you want to debug on, rather than the Visual Studio machine, download and install the correct version of the remote tools from the links in the following table.

  • Download the most recent remote tools for your version of Visual Studio. The latest remote tools version is compatible with earlier Visual Studio versions, but earlier remote tools versions aren't compatible with later Visual Studio versions. (For example, if you are using Visual Studio 2017, download the latest update of the remote tools for Visual Studio 2017. In this scenario, do not download the remote tools for Visual Studio 2019.)
  • Download the remote tools with the same architecture as the machine you're installing them on. For example, if you want to debug a 32-bit app on a remote computer running a 64-bit operating system, install the 64-bit remote tools.
VersionLinkNotes
Visual Studio 2019Remote toolsCompatible with all Visual Studio 2019 versions. Download the version matching your device operating system (x86, x64, or ARM64). On Windows Server, see Unblock the file download for help downloading the remote tools.
Visual Studio 2017Remote toolsCompatible with all Visual Studio 2017 versions. Download the version matching your device operating system (x86, x64, or ARM64). On Windows Server, see Unblock the file download for help downloading the remote tools.
Visual Studio 2015Remote toolsRemote tools for Visual Studio 2015 are available from My.VisualStudio.com. If prompted, join the free Visual Studio Dev Essentials program, or sign in with your Visual Studio subscription ID. On Windows Server, see Unblock the file download for help downloading the remote tools.
Visual Studio 2013Remote toolsDownload page in Visual Studio 2013 documentation
Visual Studio 2012Remote toolsDownload page in Visual Studio 2012 documentation
VersionLinkNotes
Visual Studio 2017Remote toolsCompatible with all Visual Studio 2017 versions. Download the version matching your device operating system (x86, x64, or ARM64). On Windows Server, see Unblock the file download for help downloading the remote tools. For the most recent version of the remote tools, open the Visual Studio 2019 doc.
Visual Studio 2015Remote toolsRemote tools for Visual Studio 2015 are available from My.VisualStudio.com. If prompted, join the free Visual Studio Dev Essentials program, or sign in with your Visual Studio subscription ID. On Windows Server, see Unblock the file download for help downloading the remote tools.
Visual Studio 2013Remote toolsDownload page in Visual Studio 2013 documentation
Visual Studio 2012Remote toolsDownload page in Visual Studio 2012 documentation

You can run the remote debugger by copying msvsmon.exe to the remote computer, rather than installing the remote tools. However, the Remote Debugger Configuration Wizard (rdbgwiz.exe) is available only when you install the remote tools. You may need to use the wizard for configuration if you want to run the remote debugger as a service. For more information, see (Optional) Configure the remote debugger as a service.

Note

  • To debug Windows 10 apps on ARM devices, use ARM64, which is available with the latest version of the remote tools.
  • To debug Windows 10 apps on Windows RT devices, use ARM, which is available only in the Visual Studio 2015 remote tools 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.

Set up the remote debugger

  1. On the remote computer, find and start the Remote Debugger from the Start menu.

    If you don't have administrative permissions on the remote computer, right-click the Remote Debugger app and select Run as administrator. Otherwise, just start it normally.

    If you are planning to attach to a process which is running as an administrator, or is running under a different user account (such as IIS), right-click the Remote Debugger app and select Run as administrator. For more information, see Run the remote debugger as an administrator.

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

  3. If the Windows Web Services API is not installed, which happens only on Windows Server 2008 R2, select the Install button.

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

  5. Select Configure remote debugging to configure the firewall and start the remote debugger.

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

    The remote debugger is now waiting for a connection. Use the server name and port number shown to set the remote connection configuration in Visual Studio.

To stop the remote debugger, select File > Exit. You can restart it from the Start menu, or from the command line:

Note

If you need to add permissions for additional users, change the authentication mode, or port number for the remote debugger, see Configure the remote debugger.

Remote debug the project

The debugger cannot deploy Visual C# or Visual Basic desktop applications to a remote machine, but you can still debug them remotely as follows. The following procedure assumes that you want to debug it on a computer named MJO-DL, as shown in the illustration below.

  1. Create a WPF project named MyWpf.

  2. Set a breakpoint somewhere in the code that is easily reached.

    For example, you might set a breakpoint in a button handler. To do this, open MainWindow.xaml, and add a Button control from the Toolbox, then double-click the button to open it's handler.

  3. In Solution Explorer, right-click the project and choose Properties.

  4. On the Properties page, choose the Debug tab.

  5. Make sure the Working directory text box is empty.

  6. Choose Use remote machine, and type yourmachinename:port in the text box. (The port number is shown in the remote debugger window. The port number increments 2 in each version of Visual Studio).

    In this example, use:

    MJO-DL:4022 on Visual Studio 2017

  7. Make sure that Enable native code debugging is not selected.

  8. Build the project.

  9. Create a folder on the remote computer that is the same path as the Debug folder on your Visual Studio computer: <source path>MyWPFMyWPFbinDebug.

  10. Copy the executable that you just built from your Visual Studio computer to the newly-created folder on the remote computer.

    Caution

    Do not make changes to the code or rebuild (or you must repeat this step). The executable you copied to the remote machine must exactly match your local source and symbols.

    You can copy the project manually, use XCopy, Robocopy, Powershell, or other options.

  11. Make sure the remote debugger is running on the target machine (If it's not, search for Remote Debugger in the Start menu). The remote debugger window looks like this.

  12. In Visual Studio, start debugging (Debug > Start Debugging, or F5).

  13. If prompted, enter network credentials to connect to the remote machine.

    The required credentials vary depending on your network's security configuration. For example, on a domain computer, you can enter your domain name and password. On a non-domain machine, you might enter the machine name and a valid user account name, like MJO-DLname@something.com, along with the correct password.

    You should see that the WPF application's main window is open on the remote computer.

  14. If necessary, take action to hit the breakpoint. You should see that the breakpoint is active. If it isn't, the symbols for the application haven't loaded. Retry, and if that doesn't work, get information about loading symbols and how troubleshoot them at Understanding symbol files and Visual Studio's symbol settings.

  15. On the Visual Studio machine, you should see that execution has stopped at the breakpoint.

    If you have any non-code files that need to be used by the application, you need to include them in the Visual Studio project. Create a project folder for the additional files (in the Solution Explorer, click Add > New Folder). Then add the files to the folder (in the Solution Explorer, click Add > Existing Item, then select the files). On the Properties page for each file, set Copy to Output Directory to Copy always.

Set Up Debugging with Remote Symbols

Visual Studio Remote Develop

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.

Visual Studio Remote Desktop

Visual Studio Live Share

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

Visual Studio Vdi

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

Visual Studio Code Remote Desktop

See also