【发布时间】:2011-07-14 19:15:58
【问题描述】:
当我尝试在 Visual Studio 中向我的 WCF 服务添加服务引用时,我收到错误“不支持协议 'net.msmq'”。
我已经成功运行appcmd set site "Default Web Site" -+bindings.[protocol='net.msmq',bindingInformation='localhost']
我可以在 applicationHost.config 文件中看到配置。由于我在 Visual Studio 中运行我的服务,我是否需要为我的特定应用程序启用 net.msmq 协议(appcmd set app "Default Web Site/MsmqService" /enabledProtocols:net.msmq)?由于我的服务在 Visual Studio 中运行,我不确定该怎么做?如果我不需要这样做,还有什么问题。这是我的配置。任何帮助表示赞赏..
<configuration>
<system.serviceModel>
<services>
<service name="MessageRoutingService"
behaviorConfiguration="ServiceBehavior">
<host>
<baseAddresses>
<add baseAddress="http://localhost:29376" />
</baseAddresses>
</host>
<endpoint name="Response"
address="net.msmq://localhost/private/Response"
binding="netMsmqBinding"
bindingConfiguration="TransactedBinding"
contract="IResponse" />
<endpoint
address="mex"
binding="mexHttpBinding"
contract="IMetadataExchange" />
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="ServiceBehavior">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
<bindings>
<netMsmqBinding>
<binding name="TransactedBinding">
<security mode="None">
</security>
</binding>
</netMsmqBinding>
</bindings>
</system.serviceModel>
</configuration>
【问题讨论】:
-
查看 Tom Hollander 的三部分 blog post series,了解如何让 MSMQ、IIS 和 WCF 很好地协同工作。我个人通常手动创建 MSMQ 配置,只是将公共接口作为服务器和客户端之间的公共程序集共享
-
感谢您的回复,我已经阅读了 Tom Hollanders 的博客,但仍然无法解决
-
你能让它工作吗?我在我的项目中遇到了完全相同的问题。尝试将服务引用添加到服务应用程序,我遇到了同样的问题。我的 web.config 看起来也和你的几乎一模一样。