I have several apps hosted in IIS that are running at the same time. When I attach to a process in the Visual Studio debugger, I see several w3p processes. The only way I can tell which one to attach to is by trial and error (if I attach to the wrong one, the breakpoints say they will not be hit). How can I know right away which process to attach to?
Asked
Active
Viewed 2,093 times
4
-
[appcmd](http://stackoverflow.com/questions/748927/iis-application-pool-pid) maybe? – rene May 30 '13 at 18:14
-
Most of the time it doesn't hurt to attach to multiple `w3wp.exe` processes, the debugger only debugs in the loaded project. – oɔɯǝɹ May 30 '13 at 18:55
-
@oɔɯǝɹ, I've done that before but the problem is sometimes I want to debug more than one (since they talk to each other) and you can't have a process attached to more than 1 debugger – JoelFan May 30 '13 at 19:00
-
So have a solution with both projects in it... – Ross Presser Jun 21 '13 at 18:07
2 Answers
3
Using the taskmanager, view processes, add column process id.
Trigger a page to see some CPU usage. Now you know the process to attach to.

oɔɯǝɹ
- 7,219
- 7
- 58
- 69
3
Unless you've changed app pool settings, the name of the application pool will appear as part of the "User Name" in the attach window:
What would be really nice would be if this user name could also appear in the Processes window, so when attached to multiple processes you could figure out which was which. But that doesn't seem possible.

Ross Presser
- 6,027
- 1
- 34
- 66