如何从 Visual Studio 中调试 IIS 上的两个 Web 应用程序/服务?
在 Visual Studio 2010 中, 我想同时调试在 IIS 上运行的两个 Web 应用程序。 调试第一个应用程序时一切正常。但是当开始调试第二个应用程序且第一个程序仍处于调试模式时,Visual Studio 会提示:
无法在 Web 服务器上启动调试。调试器已经存在 附上
我该如何解决这个问题?
In Visual Studio 2010,
I want to debug two web applications running on IIS at the same time.
When debugging the first application it is ok. But when starting to debug the second application and first program is still in debug mode, Visual Studio prompts:
unable to start debugging on the web server. a debugger is already
attached
How can I solve this problem?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
总而言之,必须在 IIS 中设置不同的应用程序池,以便两个应用程序进行调试。
这是一个粗略的说明,因为这两个应用程序都已在 Visual Studio 中部署到 IIS。
,这样应用程序应该是可调试的并行,因为每个应用程序池都会生成一个新的操作系统进程,可以将单独的调试器附加到该进程。
To summarize, one has to set different application pools in IIS for the two applications to debug.
Here is a rough instruction, given that both applications have been deployed to IIS once within Visual Studio.
This way the applications should be debuggable in parallel because each Application Pool spawns a new operating system process to which a separate debugger can be attached.
Windows 进程在给定时间只能附加一个调试器。如果您收到该消息,则意味着您正在尝试两次调试同一进程,但这是行不通的。但这也意味着您应该能够在已附加的 Visual Studio 实例中调试这两个 Web 应用程序。它可能需要一些额外的步骤,但要让它确认其他代码
(可能不需要第二步),您应该能够在两个 Web 应用程序中设置断点并以其他方式调试它们。
A windows process can only have one debugger attached to it at a given time. If you get that message it means that you're attempting to debug the same process twice which won't work. But that also means you should be able to debug both web applications in the instance of Visual Studio that's already attached. It may require a few extra steps though to get it to acknowledge the other code
After that though (second step may not be necessary) you should be able to set break points in both web applications and otherwise debug them.