Tuesday, September 20, 2011

Finding the right web process to debug

I've always found it a bit annoying when I am using "Attach to process" to debug my code and see something like this:

Which w3wp.exe should I attach to? Ah, why not attach to all of them, even though you know it's not necessary.

Recently a wise man showed me a trick to find out which web process I should attach to just by adding a command as an external tool.

In Visual Studio, just go to Tools -> External Tools and then press "Add".

For the 'Title' you can choose what ever you want to call your External Tool, I chose to call it "Find web process".
For the 'Command', just paste this: %windir%\system32\inetsrv\appcmd.exe and for the 'Arguments' you should use "list wp". Make sure you check "Use output window" and then just click "OK".

Now you can use your newly created command from the menu bar under "Tools" and the result will be shown in the output window. To make it even easier you can add a keyboard shortcut to it too, more about that here.

The appcmd application is part of IIS7. It's a fully featured command line interface to IIS so everything (probably) you can do through the IIS Manager UI you can do through appcmd. You can find more information about appcmd here.


  1. You are truly a just right webmaster. The site loading speed is incredible. It seems that you are doing any unique trick. Also visit my site: 토토사이트

  2. I read tһis piece of writing completely ⅽoncerning tһe
    difference of latest and ⲣreνious technologies, it’s amazing article. 온라인경마

  3. Really appreciate you sharing this article post. Really thank you! Really Cool. 바카라사이트

  4. Greetings! Very helpful advice within this article!
    It is the little changes that make the greatest changes. Thanks a lot
    for sharing! 사설토토