Tuesday, October 9, 2012

Attaching & Debugging to a specific w3wp.exe

Very common thing we developers do or run into is attaching all the w3wp.exe process while debugging.

Simply because we don't know which service a/c or IIS process to be attached while debugging.
Now in my case, as shown below I have to confirm (7 times) attachment of process, right! That's another fold to the debugging process.

 














Save the grief by use this little script to know your exact web application and attach to it irrespective of service A/C.
 
@ECHO OFF
cls
c:\Windows\System32\inetsrv\appcmd list wp

Save the above as wp.bat and store in C:\windows\system32 folder, I am choosing this because the path already added to the Environmental variable's path, which means now I can call this file from any command prompt path/folder location.

I will be invoking the script from H:\> by typing "wp" and enter.
Results shown as below & In my case I will be only attaching to 9044.

Happy debugging!

No comments: