如何调试Web服务,从Web应用程序中的C#.NET解决方案 [英] how to debug web service in a c#.net solution from web application

查看:242
本文介绍了如何调试Web服务,从Web应用程序中的C#.NET解决方案的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经包括在使用Web服务C#.NET 8个项目的应用解决方案。

I have an application Solution consisting of 8 projects in c#.net with Web services.

的项目之一是Web服务。

one of the projects is of web services.

所有的数据是通过在Win形式的Web服务中获取。

all the data is fetched through the Web services in Win forms.

但在调试时我的Windows应用程序我无法调试网络服务要求在Visual Studio 2010中获取数据。

but while debugging my windows application i am unable to debug the web services called for fetching the data in visual studio 2010.

请建议如何调试Web服务项目的解决方案时,读取数据的事件被解雇。

Please suggest how to debug web services project in solution when data fetching events are fired.

推荐答案

通常情况下,在Visual Studio调试时所选择的启动项目将在调试模式下执行。你的情况,你需要启动和调试了Web API项目还有WinForms项目。你可以通过在Solution Explorer中右键单击并选择设置启动项目。打开一个对话框,在这里您可以选择多启动项目,然后选择哪些项目开始调试解决方案时。

Normally, when debugging in Visual Studio the selected StartUp project will be executed in debug mode. In your case you need to start and debug both the Web API project as well as the WinForms project. You can do that by right-clicking in the solution explorer and selecting Set StartUp Projects. A dialog box opens where you can select Multiple startup projects and then select which projects to start when debugging the solution.

另一种选择是有一个启动项目(网络API项目,因为这是为其他项目运行)的要求。然后,您可以在WinForms项目在Solution Explorer中右键单击并选择调试 - > 开始新的实例。你可以这样做多次调试同一项目的多个实例。

Another option is to have a single StartUp project (the Web API project as this is a requirement for the other project to run). You can then right-click on the WinForms project in the solution explorer and select Debug -> Start new instance. You can do this multiple times to debug multiple instances of the same project.

显然,你可以在调试器始终连接到任何正在运行的进程,如果你的Web API使用部署IIS会已经在运行。使用Visual Studio上述将连接到正确的工作进程的步骤。

Obviously, you can always attach the debugger to any running process and if your Web API is deployed using IIS it will already be running. Using the procedure outlined above Visual Studio will attach to the right worker process.

这篇关于如何调试Web服务,从Web应用程序中的C#.NET解决方案的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆