How to identify your application worker process (w3wp)
When working with multiple application pools it’s being difficult while debugging your asp.net web application to identify the worker process (w3wp.exe) you want to attach your debugger to.
To identify your application worker process (w3wp), You have to get the correct worker process ID to do so:
For Window 2008 or Vista (IIS 7.0)
- IIS 7.0 shipped with a new utility called AppCmd which serve as a command line server management utility.
- This tool located in %systemroot%\system32\inetsrv\AppCmd.exe
- To list current worker process Id’s along with its corresponding site use the below command
AppCmd.exe list wps
- once you got your application worker process Id, you select the correct worker process from “Attach to Process” dialog on Visual Studio.
For Window 2003 (IIS 6.0)
- Use iisapp.vbs script, a command line tool included in IIS 6.0 is used to list worker processes
- This script located in %SystemRoot%\System32\IIsApp.vbs
- Run it by typing
cscript IIsApp.vbs
- once you got your application worker process Id, you select the correct worker process from “Attach to Process” dialog on Visual Studio.
Hope it helps.