在 VS2010 中,有没有办法知道给定的 w3wp.exe 正在服务哪个应用程序池,然后决定将调试器附加到?
因此,我正在调试一些在单独的应用程序池中本地运行的网站(一个来自主干,一个来自分支)。我在两个 VS 实例中打开了主干和分支解决方案。我想在一个中调试主干,在另一个中调试分支。我想知道是否有一种方法可以知道每个 w3wp.exe 正在服务哪个应用程序池,以便在附加调试器时知道哪个是哪个应用程序池。
更新:这样做的目的是在 VS 中编写一个宏,然后让我有一个按钮(每个有趣的应用程序池),可以单击该按钮来附加调试器。因此解决方案最好不涉及其他程序。
Update2:这是在 Windows 7 上针对 IIS7 的。
So I'm debugging some websites (one from trunk, one from branch) running locally, in separate apppools. I have trunk and branch solutions open in two VS instances. I'd like to debug trunk in one, and branch in the other. I'd like to know if there's a way to know which application pool each w3wp.exe is serving, to know which one is which when attaching the debugger.
Update: the point of this is to write a macro within VS to then let me have a button (per app-pool that is interesting) which will be clickable to attach the debugger to. So solutions should preferably not involve other programs.
Update2: this is on Windows 7 against IIS7.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
下面是我的核心宏。编写一些单行子程序来调用它,例如
AttachToW3wp("DefaultAppPool")
命名您感兴趣的每个应用程序池,并为它们制作按钮和热键。Below is my core macro. Write a few one-line subs calling it, like
AttachToW3wp("DefaultAppPool")
naming each app pool you’re interested in, and make buttons and hotkeys for them.另一种选择是 WADA - W3WP Advanced Attacher视觉工作室画廊。我通过在扩展管理器的在线图库中搜索“附加工作人员”找到了它。
Another option would be the WADA - W3WP Advanced Attacher available in the Visual Studio Gallery. I found it by searching in the Online Gallery of Extension Manager for "attach worker".
查看此问题的答案。您可以从命令窗口运行内置脚本来执行此操作。
Look at the answers to this question. There are built in scripts you can run from a command window to do this.
如果您可以在每个分支上执行请求,则可以使用类似 Process Explorer< /a> 或任务管理器来查看哪个 ID 可能是哪个 ID,因为假设您可以实现这种分离,则可能会占用当前正在处理请求的 CPU 周期。
If you can execute a request on each branch, you could use something like Process Explorer or Task Manager to see which ID is which possibly as one may be taking up CPU cycles that is currently processing a request assuming you can get such separation.
您可以使用任务管理器查看进程运行时的用户名(一般与应用程序池名称相同)和进程ID,但是您必须在任务管理器中打开这些列,同时还要打开进程名称必须与应用程序池相同(据我所知,这是默认值)。
另请注意,此页面上列出的所有方法可能只显示当前正在运行的进程,这意味着如果您的特定进程由于空闲时间而关闭,您必须首先使用该站点才能将该进程显示在列表中,在您的情况下,这意味着您应该首先访问所有站点以确保与它们关联的进程正在运行。
You can use task manager to view the user name under which the process is running (which in general is the same as the application pool name) and the process ID, but you have to turn on these columns in task manager, and also the process name has to be the same as the application pool (which is the default as far as I know).
Also note that all methods listed on this page might only display the processes that are currently running, which means that if your particular process has shut down due to idle time you have first to use the site in order to bring the process up in the list, and in your case it means you should first access all sites to make sure that the process associated with them is runing.