I've had this problem for a while now both in VS2008 and VS2010. Visual Studio will sometimes refuse to list a running "w3wp.exe" process in the "Attach to process" dialog. It is just missing from the list even though task manager shows it as running. This happens sometimes in as little as a few minutes of developing, but sometimes takes an hour or so. I cannot seem to put my finger on the exact repro steps, which I know makes it that much more difficult to debug.
The only way to get Visual Studio to recognize "w3wp.exe" when it gets into this state is to exit Visual Studio and start it again, at which time "w3wp.exe" appears and I have no problem attaching.
* I have both "Show processes from all users" and "Show processes in all sessions" checked in the attach to process dialog.
* The "Attach to:" mode is "Automatic: Native code" and I am attaching to the local machine. Selecting other modes manually does not fix the problem - I have tried them all.
* The "w3wp.exe" is DEFINITELY running (task manager / process explorer show that it is) and I have hit the pages I am developing through a web browser to be sure.
* I DO NOTHING ELSE (no web page hits, no iisreset, etc...) other than restarting Visual Studio to get the process to appear in the attach dialog.
* "w3wp.exe" is running as a different user so that the "Attach to process" dialog will prompt me if it is OK to attach. Answering yes will result in a successful attach (when the process is listed).
* I have tried both "iisreset" and killing "w3wp.exe" to get it to appear, but to no avail. After resetting and before I start the attach dialog, I hit the pages with a web browser to make sure that "w3wp.exe" is restarted and running.
* I am running Visual Studio 2010 Ultimate and the only 3rd-party add-on I have installed is JetBrains ReSharper v5.1