.net 无法将调试器附加到 w3wp

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/4313206/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-03 14:58:39  来源:igfitidea点击:

Cannot attach debugger to w3wp

.netdebuggingw3wp

提问by Xaqron

I'm debugging an ASP.NETapplication but sometimes cannot find w3wpneither in Visual Studioprocess 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) !

我正在调试一个ASP.NET应用程序,但有时w3wpVisual Studio进程列表 (Menu Debug -> Attach to Process...:) 和task manager. 我已选中“ Show processes from all users”和“ Show processes in all sessions”复选框。当从 运行项目时localhost,在发生未经处理的异常后,调试器将附加到 w3wp(对我来说太晚了,无法进入代码)!

Why I cannot see w3wp sometimes ?

为什么有时看不到 w3wp?

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

回答by Sandy

When you reset IIS or IIS is not running, you need to make a call to the server, when you hit the server for the first time the w3wpprocess starts.

当您重置 IIS 或 IIS 未运行时,您需要调用服务器,当您第一次访问服务器时w3wp进程启动。

回答by R B

THe same thing happened to me. After an update I couldnt find the W3WP! I realized that it didnt show all the processes. Checking the checkbox 'Show processes from all user' was required.

这样的事情我也经历过。更新后我找不到W3WP!我意识到它没有显示所有的过程。需要选中“显示所有用户的进程”复选框。

回答by Anthony Leonard

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...

同样的事情发生在我身上,当我想起 IIS 有空闲超时时!如上所述proc w3wp正在运行,但是VS2010在睡眠状态下查看它并认为它没有运行,所以没有在列表中显示它......

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

启动 IIS [在您最喜欢的 Web 浏览器中调用从 locahost 提供的站点] 重新激活 IIS,然后 VS 现在也可以看到进程 [w3wp]

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!

注意 - 必须要求 MS 忽略 IIS/w3wp 的睡眠状态,如果它处于睡眠模式 - 使其自动唤醒!

thanks

谢谢

回答by Jason Marsell

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

在 Visual Studio 中调试 WCF 服务时,快速修复此问题:

  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.

  1. 弹出打开您的客户端应用程序的 web.config 文件。

  2. 查找未出现在附加到进程中的服务的端点条目。

  3. 按 Ctrl+单击端点 url,以便它在 Visual Studio 的内部浏览器中加载服务窗口。

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.

就是这样。IIS 将启动,您现在可以返回到您的服务并在进程列表中找到 W3WP.exe。

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

此外,请确保选中“显示所有用户的进程”。

回答by Catto

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.

此外,当左下角的附加到进程窗口打开时,有一个复选框“显示所有用户的进程”,确保选中此复选框,然后它就会显示出来。您可能也需要以管理员身份运行 Visual Studio。希望这可以帮助。

回答by Hatjhie

I also encountered the same problem. Just build the project again. It would then show up the w3wp.exe in the attach process list.

我也遇到了同样的问题。只需再次构建项目。然后它会在附加进程列表中显示 w3wp.exe。

回答by siphab

Make sure you run VS as an administrator.

确保以管理员身份运行 VS。

回答by DeveloperDan

Look closely at the URL of the page you are debugging in the off chance that it changed to a different server - something that may rarely happen but happened to me. This falls under the category of "check your assumptions".

仔细查看您正在调试的页面的 URL,以防它更改到不同的服务器——这可能很少发生,但发生在我身上。这属于“检查您的假设”类别。

回答by DeadlyChambers

I don't how, but there appeared to be an extra application tied to the app pool I was using. Try creating a new app pool and point your application to the newly created app pool. Double check there is only 1 application with your new app pool.

我不知道如何,但似乎有一个额外的应用程序与我使用的应用程序池相关联。尝试创建一个新的应用程序池并将您的应用程序指向新创建的应用程序池。仔细检查您的新应用程序池中只有 1 个应用程序。