While debugging my web part, it was very annoying to look for the specific w3wp.exe and get it attached to step through the code. Most of the times, I could see there were multiple w3wp.exe listed when I went to “Debug –> Attach to process…”.
Unnecessarily, I had to attach them to all.
Apparently, there is a way to look for your process and attach your Visual Studio environment only to that worker process. Microsoft has a vbscript command that does just that. To get the list of the worker process and figure the one which you need, follow the below steps:
- Go to Command prompt.
- Go back to the Root directory “C:”.
- Type IISAPP.vbs and press enter.
This will give you the required list. Now you can easily identify the Process ID of the SharePoint site by looking at the AppPoolID.