Friday, October 16, 2009

Identifying the Worker process

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:

  1. Go to Command prompt.
  2. Go back to the Root directory “C:”.
  3. 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.

Technorati Tags: ,,,,