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