Share via


Remote Debugger Port Assignments

The Visual Studio Remote Debugger can run as an application or as a background service. When it runs as an application, it uses a port that is assigned by default as follows:

  • Visual Studio 2022: 4026

  • Visual Studio 2019: 4024

  • Visual Studio 2017: 4022

  • Visual Studio 2015: 4020

  • Visual Studio 2013: 4018

  • Visual Studio 2012: 4016

The Remote Debugger Port on 32-bit Operating Systems

In the remote debugger window, click Tools > Options, and set the TCP/IP port number.

On the command line, start the remote debugger with the /port switch: msvsmon /port <port number>.

You can find all the remote debugger command line switches in the remote debugging help (press F1 or click Help > Usage in the remote debugger window).

The Remote Debugger Port on 64-bit Operating Systems

This port is configurable from the command line: Msvsmon /wow64port <port number>.

Remote Debugger Ports on Microsoft Azure App Service

Remote debugger ports are configurable. Currently, Azure App Service doesn't use the default ports associated with your version of Visual Studio. Azure App Service uses port 4024 for the remote debugger.

The Discovery Port

UDP 3702 is used for finding running instances of the remote debugger on the network (for example, the Find dialog in the Attach to Process dialog). It's used only for discovering a machine running the remote debugger, so it's optional if you have some other way of knowing the machine name or IP address of the target computer. This port is a standard port for discovery, so it can't be configured.

The discovery port must be opened as an outbound port (outbound rule).

If you do not want to enable discovery, you can start msvsmon from the command line with discovery disabled: Msvsmon /nodiscovery.

See also