New Improved Attach to Process Dialog Experience

Harshada Hole

With Visual Studio 2022, we promise to bring new tooling to improve the inner loop productivity and debugging experience. In addition, we have several exciting debugging updates, and the new Attach to Process dialog experience is one of them.

We have added command-line details, app pool details, parent/child process tree view, and the select running window from the desktop option in the attach to process dialog. These make it convenient to find the right process you need to attach. Also, the Attach to Process dialog is now asynchronous, making it interactive even when the process list is updating. All these features should be available in the latest Visual Studio 2022 preview version.

Let’s check them out!

Command-Line and AppPool details in Attach to Process dialog

When debugging multiple ASP.NET Core applications, numerous instances will show as dotnet.exe’s in the available process list.

Similarly, when you have multiple web applications running with multiple application pools on your machine, they will create multiple worker processes (W3WP.exe). To make sure the Visual Studio debugger pauses at your breakpoint you need to select the right worker process that belongs to the target web application.

For both the above scenarios, figuring out the process to attach to was challenging. To find the right process you will need to get the PID using tools such as Task Manager and then use command line details to determine the right dotnet.exe process or use appcmd.exe utility to determine which PID belongs to which IIS process. Finally, select that process in the attach to process dialog to attach with the debugger.

Starting VS2022 Preview 2 you will see all these details in the Attach to Process dialog itself. We have added a new Command-Line column or App Pool details in the Title column when applicable, so you don’t need to go back and forth with other tools to differentiate between identical-looking processes.

Attach to process Dialog: AppPool details in the Title column

Attach to Process dialog: AppPool details in the Title column

Automatic refresh Process View

When checked, the auto-refresh checkbox will refresh the process list automatically with the available processes. Thus, the process list gets updated asynchronously and gives the updated processes in real-time.

 

Show Process Tree

This checkbox will swap out available processes flat list to hierarchical parent-child view. This could be helpful when the application you are debugging spawns multiple processes.

For e.g. if you are trying to debug Chromium, it can become challenging because of its multi-process architecture. When you select Run in the debugger, by default only the main browser process will be debugged. The code that renders web pages will be in separate child processes. The new process tree view can show you how these processes are related, making it easy to identify the right child process to attach to.

Attach to process Dialog: Process Tree View  

Attach to Process dialog: Process Tree View

Attach to running process from the desktop

The “Select Window” button under the Available Process lets you pick any running window/application and attach it to its associated process.

You don’t need to know the process name associated with that application or need to search through the processes list; you can conveniently point to the window on your desktop and attach it to the process in just couple of clicks.

A picture containing text, computer, computer, indoor Description automatically generated

Attach to Process dialog: Select running window process

Your feedback matters!

We want your help making Visual Studio 2022 the best developer experience for you. We encourage you to download Visual Studio 2022 Preview and try out these features. We appreciate your time in providing feedback via Developer Community, reporting a problem.