Get Running Worker Process using Command Prompt

In SharePoint / DotNet, If you want to debug your code, you need to attach the particular worker process in Visual Studio to start debugging. To attach a process we can go to Tools > Attach Process or use shortcut key Ctrl + P.

After opening the "Attach to Process", one can see a list of many w3wp processes in which we will get confuse. To know the exact currently running worker process(w3wp.exe) from the multiple list displayed one can follow the below approaches.

1. By using Command Prompt also we can find the process ID (IIS 7)

go to Start menu and type cmd in the search and Run the Command in Admin Mode,

Type the following commands after the command prompt is loaded.
 a. Change directory to Root drive (C:) using "cd/" commands in command prompt.
 b. Change directory to Windows folder using "cd windows"
 c. Change directory to System32 folder using "cd system32"
 d. Change the directory to inetsrv using "cd inetsrv"
 e. type in the below command and press enter
     Command: "appcmd list wp"
 f. you can see a list of web applications with worker process id.

command prompt to find running worker process

Remember the Process ID and attach the process by clicking on attach button to start the debugging.

For more details visit Microsoft.

2. Using User Interface also you can find the worker process.

You have to open IIS > Click on the worker process

IIS worker process

after clicking on worker processes find your site and process id under the list of web applications. remember the Process ID and attach the process by clicking on attach button to start the debugging.

Hope this will helps you. Thanks for Visiting my site.

Sudheer Gangumolu

I'm a Software Analyst / Developer / Blogger, having good experience in working with different flavors & Customization of SharePoint (i.e.,SP O365 / 2013 / 2010 / 2007) and .Net Apps. Currently, working on SharePoint 2013 / SharePoint O365. Guiding people on my technologies.

    Blogger Comment
    Facebook Comment


  1. Nice Article. I was looking for something like this. It very hectic situation to go always in IIS to check worker Process.


  2. Just one additional point. Run the command prompt as an administrator

  3. Thank you Soumyadev, I have updated accordingly.