简体   繁体   English

如何调试WCF服务?

[英]How to Debug WCF Service?

I am creating a WCF service wherein mobile devices(Iphone & Android) and websites can connect to the service. 我正在创建一个WCF服务,其中移动设备(Iphone和Android)和网站可以连接到该服务。 I hosted my service on IIS7 and my IDE is VS2010. 我在IIS7上托管我的服务,我的IDE是VS2010。

When an Iphone connects on my service and call a certain function in which I placed a break point, visual studio won't stop or toggle to the breakpoint. 当Iphone连接我的服务并调用我放置断点的某个功能时,visual studio将不会停止或切换到断点。 I've tested it using web client and there was no problem debugging and adding the breakpoint. 我已经使用Web客户端测试了它,调试和添加断点没有问题。

I used WebInvoke on my wcf service. 我在我的wcf服务上使用了WebInvoke My configuration contains this line <compilation debug="true" targetFramework="4.0" /> , both client and in the service. 我的配置包含此行<compilation debug="true" targetFramework="4.0" /> ,包括客户端和服务。

Your help is greatly appreciated. 非常感谢您的帮助。 Best, 最好,

When running a WCF service under IIS7, you need to attach your debugger to the w3wp.exe process, from an instance with administrative privileges. 在IIS7下运行WCF服务时,需要从具有管理权限的实例将调试器附加到w3wp.exe进程。 If you left the debugger running for a long time before calling the service from your phone, most likely the process was shutdown, and your debugger was no longer attached. 如果您在从手机调用服务之前将调试器运行了很长时间,则很可能该过程已关闭,并且您的调试器已不再连接。

If that's the case, you can always modify the recycling condition settings of your application pools, so the process will remain alive for a longer time. 如果是这种情况,您可以随时修改应用程序池的回收条件设置,这样该过程将保持较长时间。

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

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