{"id":234356,"date":"2021-09-07T01:00:33","date_gmt":"2021-09-07T08:00:33","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/visualstudio\/?p=234356"},"modified":"2021-09-07T21:48:44","modified_gmt":"2021-09-08T04:48:44","slug":"new-improved-attach-to-process-dialog-experience","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/visualstudio\/new-improved-attach-to-process-dialog-experience\/","title":{"rendered":"New Improved Attach to Process Dialog Experience"},"content":{"rendered":"<p>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.<\/p>\n<p>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.<\/p>\n<p>Let&#8217;s check them out!<\/p>\n<p><img decoding=\"async\" width=\"1223\" height=\"1003\" class=\"wp-image-234377\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2021\/09\/word-image-10.png\" srcset=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2021\/09\/word-image-10.png 1223w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2021\/09\/word-image-10-300x246.png 300w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2021\/09\/word-image-10-1024x840.png 1024w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2021\/09\/word-image-10-768x630.png 768w\" sizes=\"(max-width: 1223px) 100vw, 1223px\" \/><\/p>\n<h2>Command-Line and AppPool details in Attach to Process dialog<\/h2>\n<p>When debugging multiple ASP.NET Core applications, numerous instances will show as dotnet.exe\u2019s in the available process list.<\/p>\n<p>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.<\/p>\n<p>For both the above scenarios, figuring out the process to attach to was\u00a0challenging. 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.<\/p>\n<p>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\u2019t need to go back and forth with other tools to differentiate between identical-looking processes.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter wp-image-234378\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2021\/09\/graphical-user-interface-text-application-descr.png\" alt=\"Attach to process Dialog: AppPool details in the Title column\" width=\"1206\" height=\"982\" srcset=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2021\/09\/graphical-user-interface-text-application-descr.png 1206w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2021\/09\/graphical-user-interface-text-application-descr-300x244.png 300w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2021\/09\/graphical-user-interface-text-application-descr-1024x834.png 1024w, https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2021\/09\/graphical-user-interface-text-application-descr-768x625.png 768w\" sizes=\"(max-width: 1206px) 100vw, 1206px\" \/><\/p>\n<p style=\"text-align: center;\">Attach to Process dialog: AppPool details in the Title column<\/p>\n<h2>Automatic refresh Process View<\/h2>\n<p>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.<\/p>\n<p>&nbsp;<\/p>\n<h2>Show Process Tree<\/h2>\n<p>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.<\/p>\n<p>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.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter wp-image-234379\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2021\/09\/word-image-9.gif\" alt=\"Attach to process Dialog: Process Tree View\u00a0\u00a0\" width=\"1222\" height=\"991\" \/><\/p>\n<p style=\"text-align: center;\">Attach to Process dialog: Process Tree View<\/p>\n<h2>Attach to running process from the desktop<\/h2>\n<p>The \u201cSelect Window\u201d button under the Available Process lets you pick any running window\/application and attach it to its associated process.<\/p>\n<p>You don\u2019t 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.<\/p>\n<p style=\"text-align: center;\"><img decoding=\"async\" width=\"2487\" height=\"1605\" class=\"wp-image-234380 aligncenter\" src=\"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-content\/uploads\/sites\/4\/2021\/09\/a-picture-containing-text-computer-computer-ind.gif\" alt=\"A picture containing text, computer, computer, indoor Description automatically generated\" \/><\/p>\n<p style=\"text-align: center;\">Attach to Process dialog: Select running window process<\/p>\n<h2>Your feedback matters!<\/h2>\n<p>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 <a href=\"https:\/\/developercommunity2.visualstudio.com\/home\">Developer Community<\/a>, <a href=\"https:\/\/docs.microsoft.com\/en-us\/visualstudio\/ide\/how-to-report-a-problem-with-visual-studio?view=vs-2019\">reporting a problem<\/a>.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>With Visual Studio 2022, we promise to bring new tooling to improve the inner loop productivity and debugging experience.<br \/>\nWe 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. <\/p>\n","protected":false},"author":26573,"featured_media":234360,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[155],"tags":[9,6815,6817],"class_list":["post-234356","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-visual-studio","tag-debug","tag-visual-studio-2022","tag-vs2022"],"acf":[],"blog_post_summary":"<p>With Visual Studio 2022, we promise to bring new tooling to improve the inner loop productivity and debugging experience.<br \/>\nWe 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. <\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/posts\/234356","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/users\/26573"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/comments?post=234356"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/posts\/234356\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/media\/234360"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/media?parent=234356"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/categories?post=234356"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/visualstudio\/wp-json\/wp\/v2\/tags?post=234356"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}