

If you don't know the process name, browse through the list, or see Common debugging scenarios for some common process names. To quickly select a process, type its name or first letter in the Filter processes box. In the Available processes list, find and select the process or processes you want to attach to. You can select Refresh at any time to see the current list. Processes can start and stop in the background while the Attach to Process dialog box is open, so the list of running processes may not always be current. The Connection target setting persists between debugging sessions only if a successful debugging connection occurred with that target.Ĭlick Refresh to populate the Available processes list. The Connection type setting persists between debugging sessions. Select the computer or device you want, and then click Select. You may need to open UDP port 3702 on the server to discover remote devices. The Remote Connections dialog box lists all the devices that are on your local subnet or directly attached to your computer. Select the Find button next to the Connection target box to open the Remote Connections dialog box. For other remote debugger port assignments, see Remote debugger port assignments. 4022 is the default port for the Visual Studio 2017 remote debugger. If you can't connect using the remote computer name, try using the IP and port address (for example, 123.45.678.9:4022). 4024 is the default port for the Visual Studio 2019 remote debugger. 4026 is the default port for the Visual Studio 2022 remote debugger. Verify that Visual Studio adds the required port to the computer name, which appears in the format: :port Type the computer name in the Connection target box and press Enter. Select the drop-down arrow next to Connection target, and select the computer name from the drop-down list. In the Connection target box, select the remote computer, using one of the following methods: For more info, see other sections in this article or Common debugging scenarios.

Some scenarios, such as debugging Linux or a containerized app, require a different connection type. To attach to a running process on a remote computer: For more information, see Remote debugging.įor more complete instructions for debugging ASP.NET applications that have been deployed to IIS, see Remote debugging ASP.NET on a remote IIS computer.

The remote debugger ( msvsmon.exe) must be running on the remote computer. You can also select a remote computer in the Attach to Process dialog box, view a list of available processes running on that computer, and attach to one or more of the processes for debugging. You can set the active app in the Visual Studio Debug Location toolbar or Processes window. You can be attached to multiple apps for debugging, but only one app is active in the debugger at a time. In the scenario where you have multiple identical processes, use the Command Line column or the w3wp process details from the Title column to identify the right process. Set the Connection target to your local machine name. Some scenarios may require a different connection type. In Visual Studio, select Debug > Attach to Process (or press Ctrl+ Alt+ P) to open the Attach to Process dialog box. To attach to a process on your local computer: To quickly reattach to a process you attached to previously, see Reattach to a process. Attach to a running process on your local machine Not sure whether to use Attach to Process for your debugging scenario? See Common debugging scenarios. For example, if you're running an app without the debugger and hit an exception, you can then attach the debugger to the process running the app and begin debugging. You can use Attach to Process to debug running apps on local or remote computers, debug multiple processes simultaneously, debug apps that weren't created in Visual Studio, or debug any app you didn't start from Visual Studio with the debugger attached. After the process is running, select Debug > Attach to Process or press Ctrl+ Alt+ p in Visual Studio, and use the Attach to Process dialog to attach the debugger to the process. You can attach the Visual Studio debugger to a running process on a local or remote computer. Attach to running processes with the Visual Studio debugger
