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.
Get Running Worker Process using Command Prompt Get Running Worker Process using Command Prompt Reviewed by Sudheer Gangumolu on September 08, 2014 Rating: 5

3 comments:

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

    Ajeet
    http://asharepointsolutions.blogspot.in/

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

    ReplyDelete
  3. Thank you Soumyadev, I have updated accordingly.

    ReplyDelete