Which worker Process we should attach in Visual Studio for debugging our code Follow this article. Sometimes we need to write the code in Visual Studio for SharePoint application. And also we need to debug it.
However when we try to attach the process we get confused which w3wp process we need to attach. Because several w3wp process are continuously running on m/c. And suppose you have opened different sites on same m/c then it will be very hard to understand which process we should attach. In this situation developer may attach all the processes, which will simply burn the Visual Studio as well as it will hang all other sites because you have attached their worker process too.
So for this Microsoft suggests the following approach to find out which process you should attach. Please follow the step and save your Visual Studio as well as your farm.
1) Go to inetmgr and click on worker Process as shown in below image.
2) After clicking it will show sites and worker process which they are running in (As shown in below image)
In above image check your site’s Process ID
3) Now go to Visual Studio click attach to process and attach the process which has Process ID matching with your Site’s Process id.
Naomi N edited Original. Comment: This article can use some editing
More details on the worker process and its management using powershell can be drawn from this article: www.iis.net/.../powershell-snap-in-run-time-data