调试托管在 Web 应用程序中的 WCF 服务库未达到断点 [英] Debugging WCF service library being hosted in a web application is not hitting break points

查看:34
本文介绍了调试托管在 Web 应用程序中的 WCF 服务库未达到断点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在同一个解决方案中创建了一个 WCF 服务应用程序(在 VS 2012 中使用 IIS Express 托管的 WAS)项目和一个 WCF 类库.当我运行解决方案时,服务器应用程序在 IIS Express 下运行.我的类库命名空间是: Wfm.MarketManager.WebServices 和网络应用程序命名空间是 Wfm.MarketManager.WebServices.Web 在 Wfm.MarketManager.WebServices.Web 我有一个 .svc 文件:

I have created a WCF Service Application(WAS hosted using IIS Express in VS 2012) project and a WCF Class Library in the same solution. When I run the solution the server app runs under IIS Express. My class library namespace is: Wfm.MarketManager.WebServices and the web app namespace is Wfm.MarketManager.WebServices.Web In the Wfm.MarketManager.WebServices.Web I have a .svc file:

<%@ ServiceHost Language="C#" Debug="true" Service="Wfm.MarketManager.WebServices.ListWebService" Factory="Wfm.MarketManager.WebServices.WcfServiceFactory" %>

我有另一个 VS 2012 实例,其中有一个 Web 应用程序,该应用程序具有对从 WCF 服务应用程序 (http://localhost:12345/ListWebService.svc) 创建的内容的服务引用.该服务被正确调用,但我的断点没有被击中.我记得在创建类似项目时在 VS 2010 中工作.我错过了什么?

I have another instance of VS 2012 with a web application that has a service reference to what is created from the WCF Service Application (http://localhost:12345/ListWebService.svc) The service is getting called correctly, but my breakpoints are not getting hit inside of it. I remember this working in VS 2010 when creating similar projects. What am I missing?

推荐答案

原来我的自定义工厂 (WcfServiceFactory) 存在问题,我没有在调试器中看到.打开 includeExceptionDetailInFaults 后,我看到了它失败的地方.现在它步入正轨.然而,奇怪的是,我的工厂有一个断点.不过现在可以使用了.

Turns out there was an issue with my custom factory (WcfServiceFactory) I was not seeing in the debugger. Once I turned on includeExceptionDetailInFaults I saw where it was failing. Now it is stepping in fine. Strange thing, though, is that I had a break point in my factory. It is working now though.

<serviceDebug includeExceptionDetailInFaults="true" />

这篇关于调试托管在 Web 应用程序中的 WCF 服务库未达到断点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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