【问题标题】:WCF, MSMQ - the protocol 'net.msmq' is not supportedWCF、MSMQ - 不支持协议“net.msmq”
【发布时间】: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 看起来也和你的几乎一模一样。

标签: wcf msmq


【解决方案1】:

您需要启用组件“Microsoft Message Queue (MSMQ) Server” (1) 并在 IIS 上的应用程序中添加“net.MSMQ”协议 (2)。

  1. 转到“Microsoft 消息队列 (MSMQ) 服务器”下的“打开或关闭 Windows 功能”中选中的“程序和功能”。

  2. 转到 IIS 上的应用程序,单击“高级设置”然后“启用协议”添加此“,net.MSMQ”。

【讨论】:

  • 还有3、将net.msmq绑定添加到IIS站点。绑定信息字段应该是机器的名称。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2011-11-02
  • 2023-03-04
相关资源
最近更新 更多