I use Visual Studio 2010 to debug a asp.net MVC project in my local machine. The steps are:
Click Debug and try to attch process "w3wp.exe". However it is not in the list.
I am sure "Show processes in all sessions" is clicked.
Just because an IIS application pool is started, there may not be an IIS worker process
w3wp
running. IIS will not start the worker process until the first web request is received.
In my case, I first launched the application, still could not find w3wp.exe
. Then I took the worker process ID from (IIS->Worker Process -> Process Id
) and then search by id in the details tab and found it.
I just ran into this issue - you may want to also double check your host settings and verify that you are actually pointed to localhost and not a production server.
I forgot I was pointed at a remote server, and thus, though I was accessing the site, it wasn't anything local so w3wp wasn't running, despite my superficially being able to see the site running.
I would just like to share my experience as well for future readers.
Be aware that, in the event that you have a web server cluster configuration (for load balancing etc) the w3wp
process might not start on the same machine that you expect it to.
Unless your website is configured to only run on a single IIS instance, the w3wp
process might be spinning up on one of the other machines inside of your web cluster.
This might be faulty configuration from the networking team/department or intended behaviour. I don't have the neccessary experience to pin point exactly how it should be configured.
Found a related page on MSDN as well:
In my case, the problem was that I wasn't running Visual Studio as Administrator. My machine had restarted after an update and relaunched all the previously running processes, but had only relaunched VS in non-admin mode. When I restarted VS in admin mode, the w3wp.exe processes were available again for debugging.
Be aware that even after jumping through all these hoops (kicking off an instance using a web browser, starting your remote debugging session as an admin, ensuring that "show all users" is checked, etc., ensuring you aren't on a server farm, etc), you may still at times be out of luck.
There are times when the remote process, usually a WCF service in my case, simply will not show up in the list of processes to attach to, and there's nothing that can be done about it. I'm always careful to make my target process readily identifiable by keeping it and only it in a certain App Pool. Sometimes you just can't get there from here. This is undoubtedly the most frustrating thing about remote debugging Microsoft has ever done.
w3wp.exe
) or VS Development Server (WebDev.WebServer40.exe
)? Check under your Project Properties -> Web tab. - SliverNinja - MSFT