Sunday, February 17, 2013

Pick the right w3wp.exe to Debugging your Slution

When multiple web applications running with multiple application pools, they will create multiple worker processes (W3WP.exe). While debugging code from Visual studio,  we got pick the one belongs to the target web application, otherwise, debugger will not stop on break-points!

How to select the correct W3WP.exe to attach?

If you use different user accounts for different application pools, you can just pick the right one easily by checking "User Name" column.

Follow these instructions to find the right worker process to attach:
·         From the running processes, we'll have to get the process id value. Lets go to Windows Task Manager >> View >> Select Columns
·         Select the "PID (Process Identifier)" column from the list.
·         Now go to command prompt, go to the directory "C:\windows\System32\Inetsrv"

·         Enter "Appcmd list wp"
This will list all running worker processes and their associated web applications. Now open the Task Manager to match the PID with the desired web application's worker process ID.

Now you have the right w3wp process to attach!

No comments:

Post a Comment