40

I have an intermittent problem with visual studio unable to see the running W3wp.exe process when trying to attach to process, other instances of visual studio can see the process and restarting visual studio makes it appear in the attach to process list.

hitting the refresh button makes no difference and I can use the web application while unable to see the process in the list.

Any ideas?

Kev Hunter
  • 2,565
  • 4
  • 25
  • 39
  • 9
    Have you checked "Show for all user sessions" checkbox? Have you tried to push refresh button? – sll Oct 19 '11 at 16:40
  • yes, as mentioned above refresh makes no difference and I can usually see it. all users is checked – Kev Hunter Oct 19 '11 at 16:48
  • Are u sure u are using iis and not the vs web server? i am doubtful that the process is running at all can you see it in TaskManager while is invisible in VS attach window? – Davide Piras Oct 19 '11 at 17:51
  • Yes I can see it in task manager as it says in my answer I can see it in other instances of Visual Studio – Kev Hunter Oct 20 '11 at 08:08
  • There are some suggestions here: http://stackoverflow.com/questions/4313206/cannot-attach-debugger-to-w3wp – David Airapetyan Jul 25 '12 at 17:23

9 Answers9

69

Ensure the checkbox for the 'Show Processes for All Users' is checked.

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

Attach to Proccess window with Show Processes for All Users Checkbox**strong text**

Hope this helps you Kev Hunter!

Catto
  • 6,259
  • 2
  • 52
  • 55
53

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.

AFetter
  • 3,355
  • 6
  • 38
  • 62
19

I guess my answer may be late, but definitely it may help somebody.

I faced similar problem and was not able to find the resolution.

WHAT EXACTLY HAPPENED

If you are not able to find the instance in attach process then, GO to

IIS -> right click on the application you working -> Manage Applicaiton -> Browse

This will create a new instance. Now you can open Visual studio and try to attach process.

Manjuboyz
  • 6,978
  • 3
  • 21
  • 43
4

You have to run Visual Studio with administrator privileges (Run as administrator) to see the w3wp processes.

hege
  • 987
  • 4
  • 15
3

I had the same issue. I tried restarting the site in IIS and recycling the app pool, but neither helped. Once I clicked Browse: * (http) in IIS, the w3wp process appeared.

mpwhitt
  • 485
  • 1
  • 5
  • 14
2

First, brows your web site in IIs. If it was okay,run vs by ad adminisrator then you can attach w3wp.exe.

0

Sometimes I get this problem, and none of the solutions in this or that question work.

In this case, it often happens that there is another copy of VS10 running in the background that did not shut down properly. For whatever reason, it blocks access to many processes including w3wp.

Force that process to close and start a new instance of VS10, and you should see all processes in the Attach dialog.

Community
  • 1
  • 1
Harfatum
  • 211
  • 2
  • 5
0

Quick fix for this, when debugging WCF services in Visual Studio:

  1. Pop open your client app's web.config file.

  2. Find the endpoint entry for the service that isn't appearing in Attach To Process.

  3. Hit Ctrl+Click on the endpoint url, so that it loads the service window in Visual Studio's internal browser.

That's it. IIS will fire-up and you can now pop back over to your service and find W3WP.exe in the processes list.

Also, make sure "Show Processes From All Users" is checked.

Jason Marsell
  • 1,752
  • 2
  • 19
  • 10
0

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. Especially if you are using different websites/apps for example a front end site with a back end web API.

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