Thursday 25 September 2014

Various ways to retrieve information of Running Worker Process (WP)

About Worker Process:-
Worker process (w3wp.exe) runs the ASP.NET application in IIS. This process is responsible to manage all the request and response that are coming from the client system. All the ASP.NET functionality runs under the scope of worker process. When request comes to the server from a client worker process is responsible to generate the request and response.

While working on SharePoint object model we usually, attach w3wp.exe to debug the solution.
But having no idea, which w3wp.exe is running which sharepoint site.So usually, we attach all w3wp.exe, which is not a good practice.




There are various ways to find right worker process. 


1- Using IIS :- 

Open IIS (Type Inetmgr on run) - and Form Right pane, double click on Worker Process button available under IIS Header and you will found the exact w3wp.


 


2- Using PowerShell (My Favorite)


Just open any Powershell script editor/shell editor and type following command:

<Root>:\Windows\System32\inetsrv\appcmd.exe LIST wp | Out-GridView 

In my case Root is C: so command will be 

C:\Windows\System32\inetsrv\appcmd.exe LIST wp | Out-GridView

And Result will be like this:





3- Using Visual Studio (Adding Linl in external tool)

For this, Please follow the snaps :





Title – Get WorkerProcess (Any name you can input here).

Command -  %SystemRoot%\System32\inetsrv\appcmd.exe

Argument - List wp

Initial Directory - $(TargetDir)

"Use Output window" check box checked.

Click Apply and then OK.

Click Get WorkerProcess Link as shown below:


View Visual Studio output windows where you will find the information for Worker process as follows:

Note- Please note, after deployment/Updation of wsp, first refresh the browser and then run this tool,PowerShell cmdLet or check from IIS otherwise you will get old thread and will not work for you.

Thanks to this Link. Which provided a way to do the same.





No comments :

Post a Comment