130

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.

  • 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 Nov 19 '12 at 20:53
  • Are you using **Local IIS** (*`w3wp.exe`*) or **VS Development Server** (*`WebDev.WebServer40.exe`*)? Check under your Project Properties -> Web tab. – SliverNinja - MSFT Nov 19 '12 at 20:56
  • 10
    Have you tried to check "Show Process From all Users" option? – Irvin Dominin Nov 19 '12 at 20:56
  • Did you mean go to control panel then start IIS? I can't find it. –  Nov 19 '12 at 20:58
  • In the attach to process window; are you running visual studio 2010 as administrator? http://blogs.msdn.com/blogfiles/jannemattila/WindowsLiveWriter/eb0f5b1dcb22_12A25/VSDebugger_2.png the first option under the process list – Irvin Dominin Nov 19 '12 at 20:59
  • @Edward, yes. administrator. It uses local IIS Web server. –  Nov 19 '12 at 21:00
  • 6
    Answer in http://stackoverflow.com/questions/4313206/cannot-attach-debugger-to-w3wp tl;dr? w3wp process sleeps, so refresh page in browser to wake it up and it should now appear in list. – Ruskin Jan 22 '14 at 18:53
  • Does this answer your question? [Cannot attach debugger to w3wp](https://stackoverflow.com/questions/4313206/cannot-attach-debugger-to-w3wp) – Mark Schultheiss Sep 20 '22 at 19:20

20 Answers20

220

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.

Yan Brunet
  • 4,727
  • 2
  • 25
  • 35
107

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

Jacob Pressures
  • 1,391
  • 2
  • 12
  • 15
17
  1. Restart IIS
  2. Right click your site >> Manage Website >> Browse
  3. Back into Visual Studio refresh the processes list
Neph
  • 188
  • 1
  • 10
  • 1
    Depends on the site, it could be Manage Website, or Manage Application. Both will start the w3wp.exe process. – Milton Jun 29 '15 at 17:27
  • 1
    I didn't even have to restart IIS...I just followed steps 2 and 3 and it worked. :) Maybe the list hadn't been refreshed. – thecoolmacdude Oct 07 '15 at 16:56
10

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'

Trong Vo
  • 101
  • 1
  • 3
9

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.

3

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.

Shankar Ganesh Jayaraman
  • 1,401
  • 1
  • 16
  • 22
TBA
  • 1,921
  • 4
  • 13
  • 26
3
  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
gurkan
  • 884
  • 4
  • 16
  • 25
2

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

JrBriones
  • 2,930
  • 1
  • 13
  • 5
2

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.

Oğuzhan Soykan
  • 2,522
  • 2
  • 18
  • 33
2

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.

Eleanor Zimmermann
  • 414
  • 1
  • 8
  • 26
2

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.

Neel
  • 11,625
  • 3
  • 43
  • 61
2

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.

2

my answer is late for sure, but maybe my answer will help someone.

  1. Go To IIS.
  2. Application Pools.
  3. Advance Setting.
  4. enable 32.bit Application. enter image description here Make your Application Running Under enable 32.bit Application.
1

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

Riaan van Zyl
  • 538
  • 8
  • 17
1

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.

kkost
  • 3,640
  • 5
  • 41
  • 72
1

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.

James McCormack
  • 9,217
  • 3
  • 47
  • 57
1

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

AidaM
  • 233
  • 3
  • 16
1

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.

Mati Ullah Zahir
  • 168
  • 1
  • 3
  • 13
1

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.

markaaronky
  • 1,231
  • 12
  • 29
0

To see the w3wp.exe process in your process list, follow these steps:

  1. Ensure that your IIS server is running.

  2. Verify that the "ScadaAppPool" application pool is running. You can do this by opening the 'IIS Manager' and looking for ScadaAppPool pool under the application pools section.

  3. If both of these are running and you still do not see the w3wp.exe process, you can try recycling the application pool or forcing a request onto your application to trigger the w3wp.exe process.

To do this, you can use the following script in your terminal:

:: Change the current directory to the directory where the script is being run
cd /d "%~dp0"

:: Create a new empty file named "tempfile" in the "temp" subdirectory
type nul > temp\tempfile

:: Send an HTTP GET request to a specific URL
:: Replace "http://your-url-here" with the URL you want to send a request to
curl http://your-url-here

:: Delete the previously created "tempfile"
del temp\tempfile


:: Alternative
:: "%windir%\system32\inetsrv\appcmd" recycle APPPOOL "PoolDApplicationsName"

These commands will force the start of the w3wp.exe process, and you should now be able to see it in your process list for debugging. I hope this information is helpful.

MG messie
  • 1
  • 1