Monday 27 June 2011

How to identify the correct worker procees to attach in VS during debug.

So quite often when we have to debug by attaching to a process, we are confronted with this screen.


There are 6 w3wp.exe processes running on this machine, How do we know which one we want to debug?

There is a command that will show you. If you are running windows 2008, open up your command prompt and type
‘C:\Windows\System32\inetsrv\appcmd.exe list wp’
This will produce a result like this.


I can see that NRCAppPool is running under the worker process with the id 10436, this is the one I wanted, so all you have to do now is go back to Visual Studio and attach the IDE to the w3wp.exe with the id 10436.

If you are running windows Server 2003. Simply type iisapp, and it will display similar information.

No comments:

Post a Comment