【发布时间】:2014-09-17 07:26:46
【问题描述】:
我正在尝试使用免费的 Microsoft Visual Web Developer 2010 Express 开始使用 WCF 中的事务。它为我提供了创建“WCF 服务应用程序”的选项,但似乎并没有为我提供很多选项来托管它或配置不同的绑定。如果我 F5 项目我得到错误:
At least one operation on the 'Service' contract is configured with the TransactionFlowAttribute attribute set to Mandatory but the channel's binding 'BasicHttpBinding' is not configured with a TransactionFlowBindingElement. The TransactionFlowAttribute attribute set to Mandatory cannot be used without a TransactionFlowBindingElement.
我尝试将*/services/service/endpoint 配置添加到 web.config 中,但它似乎只是被忽略了。我还尝试将默认启动应用程序更改为 WcfSvcHost.exe,但此选项显示为灰色。我开始怀疑 Express 版本的一些失败,但我乐观地认为这只是我是个笨蛋。有没有我需要学习的技巧,或者在 Visual Studio 2010 的完整版上大放异彩就足以让我克服这个障碍并进入下一个障碍?
谢谢!
【问题讨论】:
-
你能给我们看一下服务合同和配置文件吗?
-
我正在使用“WCF 服务应用程序”中的 vanilla 示例,只是我向服务合同中的一项操作添加了 TransactionFlow 属性。 Web.config 中没有定义服务。我不知道发生了什么反射魔法,但即使我尝试使用 wsHttpBinding 设置端点(注意错误消息始终是 BasicHttpBinding)我也没有运气。
标签: wcf visual-studio-2010 visual-web-developer