SharePoint Debugging: Attach Correct W3WP Process

Being a developer, debugging is necessity. To debug we many times, face that there are more than one W3WP processes in Process list. I was confused that which is the exact process to which I should be debugging.
This process doesn’t contain information about W3WP process like Application Pool details.

W3WP-list

To know more about that process, we need to follow below steps:

  1. Open Command prompt by administrator.
  2. Navigate to folder “C:\Windows\System32\inetsrv” by running following command:
    cd “C:\Windows\System32\inetsrv”
  3. Execute this command:
    appcmd.exe list wp
    It will list down the worker process with process id and application pool name.W3Wp-pool-list

We already have our application pool detail for the site we are debugging. From the above list we should note down the process id and then in Visual studio, attach the process only to that process with specific ID we noted.

Now we are done with “Attach to Process”.
Happy debugging!

Advertisements