111
votes

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.

18
If you can't find w3wp.exe then IIS is not currently running. Make sure that the IIS Admin service is started, the WWW service is started, the application pool is started and the IIS website itself is started. - Joel Etherton
Are you using Local IIS (w3wp.exe) or VS Development Server (WebDev.WebServer40.exe)? Check under your Project Properties -> Web tab. - SliverNinja - MSFT
Have you tried to check "Show Process From all Users" option? - Irvin Dominin
Did you mean go to control panel then start IIS? I can't find it. - user1108948
Answer in stackoverflow.com/questions/4313206/… tl;dr? w3wp process sleeps, so refresh page in browser to wake it up and it should now appear in list. - Ruskin

18 Answers

191
votes

w3wp.exe won't show in the running process' unless there is actually an instance of the web application running.

Try to access your web page first, when it is displayed for the first time, try to attach your debugger. The process should now show up.

96
votes

You need to click Show Processes from All Users at the bottom of the Task Manager list. This is what i needed to do.

14
votes
  1. Restart IIS
  2. Right click your site >> Manage Website >> Browse
  3. Back into Visual Studio refresh the processes list
8
votes

Try to check on :"Show Processes for All Users" When on the 'Attach to Process' window in the bottom left there is a checkbox 'Show Processes for All Users'

4
votes

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.

3
votes

An easy way that works ,when w3wp dont appear in the list,open a browser and write localhost ,then enter.After that w3wp appears to list.

1
votes

If you are using something like Advanced Rest Client to test routes, call your route again then refresh the list of processes and it will show up

1
votes

GoTo Web Project properties -> Select (Web) on the left sidebar -> GoTo under (Servers) header -> Click to dropdown and select "Local IIS"

and apply. Then, when you start debugging you will see w3wp.exe on the proccess list.

1
votes

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.

1
votes

In my case, I have not opened the Visual Studio in Admin mode that is why the w3wp.exe was not showing on the list.

When I opened the Visual Studio in Admin mode, it worked.

Right click on Visual Studio -> Open in Admin mode.

1
votes

In my case, once I rebuild the web project and raise the limit of Connection Time out (in seconds), it automatically shows in Debug/Attach to Process list and keeps working.

1
votes
  1. Clear the Solution
  2. Rebuild the solution
  3. Reset the IIS by writing the command iisreset in command prompt
  4. Go to IIS and browse your website
  5. Run VS as administrator
  6. Tools -> Attach to process -> Ensure the 'Show Processes for All Users' checkbox is
    checked -> w3wp.exe
  7. Attach to w3wp.exec
0
votes

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:

https://msdn.microsoft.com/en-us/library/bb742600.aspx

0
votes

In my case, I needed to connect from one Visual Studio to the process which running from another VS studio window.
The problem was next: one VS was launched with Administrator permissions. For resolving that issue you should launch both VS with Admin perm.

0
votes

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.

0
votes

Run the remote debugger as an administrator. I followed every suggestion to resolve the issue, but it was not until I ran the remote debugger as an administrator that I was able to see the w3wp process

0
votes

Try the following steps:

  1. Create a virtual path from Solution Explorer.

  2. Go to inetmgr to confirm that your own pool is created.

  3. Go to Attach Process (Ctrl+Alt+P) and show processes for all users.

  4. Then you will see w3wp.exe will be there.

0
votes

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.