Do you get confused identifying which w3wp.exe to attach to in Visual Studio?

Two options for you:

Option 1 (from command prompt)

– In IIS 6: run %windir%system32cscript iisapp.vbs

– In IIS 7: %windir%system32inetsrvappcmd.exe list wp

This should give you process id with the corresponding application pool you’re interested in.

Option 2

  1. Open Windows Task Manager
  2. Add PID and Command Line to the Processes tab
  3. Find the w3wp.exe processes
  4. Look for your application pool under the Command Line tab.  Make a note of the PID
  5. The PID is the ID of the process you need to attach to in Visual Studio

I prefer option 1 as it explicitly displays your list of application pools and process IDs.

Hope this helps to solve the frustration we sometimes go through when you have so many application pools running in IIS.

Enjoy!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.