简体   繁体   English

如何让Visual Studio自动将其调试器附加到Web应用程序和Web服务?

[英]How can I make Visual Studio automatically attach its debugger to both a web application and web service?

I'm working on a Visual Studio project. 我正在开发一个Visual Studio项目。 I'm using Visual Studio 2010. The project has an ASP.NET application project and a separate ASMX web service project. 我正在使用Visual Studio 2010.该项目有一个ASP.NET应用程序项目和一个单独的ASMX Web服务项目。 The web application project is set as the start-up project. Web应用程序项目设置为启动项目。

When I tell Visual Studio to start debugging, it correctly starts both the web application and web service. 当我告诉Visual Studio开始调试时,它正确启动Web应用程序和Web服务。 However, it only attaches the debugger to the web application and not the web service. 但是,它只将调试器附加到Web应用程序而不是Web服务。 This problem seems to occur regardless of which web server I use for either project (IIS, IIS Express, Visual Studio Development Web Server). 无论我用于哪个项目(IIS,IIS Express,Visual Studio开发Web服务器),都会出现此问题。

In order to debug both simultaneously, I need to manually attach the debugger to the web service during the debugging session. 为了同时调试两者,我需要在调试会话期间手动将调试器附加到Web服务。

How can I make Visual Studio automatically attach to both projects when I tell it start debugging? 当我告诉它开始调试时,如何使Visual Studio自动附加到这两个项目?

I found that this works if I set both the web service and application to start-up projects. 我发现如果我将Web服务和应用程序都设置为启动项目,这是有效的。 Do this by right-clicking the solution file and choosing something like Set Start-up Projects... . 通过右键单击解决方案文件并选择Set Start-up Projects ...来执行此操作

One of the options is to open two instances of Visual Studio and debug the projects separately, however it is pretty much the same inconvenience as attaching the debugger manualy. 其中一个选项是打开两个Visual Studio实例并分别调试项目,但这与手动附加调试器几乎相同。

By the way, do you have ASP.NET debugger allowed in both projects (project properties > web tab > debuggers section)? 顺便说一句,你是否允许在两个项目中使用ASP.NET调试器(项目属性> Web选项卡>调试器部分)?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM