Cannot attach debugger to w3wp

2019-01-23 23:02发布

I'm debugging an ASP.NET application but sometimes cannot find w3wp neither in Visual Studio process list (Menu: Debug -> Attach to Process...) nor in task manager. I have selected 'Show processes from all users' and 'Show processes in all sessions' check boxes. When run the project from localhost, after an unhanded exception happens debugger would attach to w3wp (too late for me to step into code) !

Why I cannot see w3wp sometimes ?

Windows Server 2008 Enterprise Edition 64-bit, Visual Studio 2010

9条回答
放我归山
2楼-- · 2019-01-23 23:48

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.

查看更多
孤傲高冷的网名
3楼-- · 2019-01-23 23:48

Also when the attach to process window is open in the bottom left there is a checkbox 'Show processes from all user' make sure this check box is checked then it will show up. You may need to run visual studio as administrator to too. Hope this helps.

查看更多
来,给爷笑一个
4楼-- · 2019-01-23 23:49

Same thing was happening to me, when i remembered that IIS has an idle timeout! As above the proc w3wp is running, but VS2010 looks at it in the sleep state and thinks its not running, so dos'nt show it in the list...

spinning up IIS [calling a site served from locahost in your favourite web browser] reactivates IIS and suddenly VS can see the process [w3wp] now too

NOTE - must ask MS to ignore the sleep state of IIS/w3wp and if it is in sleep mode - cause it to automatically wake up!

thanks

查看更多
登录 后发表回答