0

尝试启动托管 WCF 服务的 Windows 服务时出现以下错误:

找不到与具有绑定 NetMsmqBinding 的终结点的方案 net.msmq 匹配的基地址。注册的基地址方案是 [http]。

如果我删除 netmsmq 绑定并使用 basichttp 绑定,则工作正常。配置如下:

  <system.serviceModel>
    <services>
      <service name="ManageContactService.ManageContact" behaviorConfiguration="ContactServiceBehavior">
        <host>
          <baseAddresses>
            <add baseAddress="http://localhost:8888/ManageContact/ContactService"/>
          </baseAddresses>
        </host>

        <endpoint address="net.msmq//localhost/private/testqueue" binding="netMsmqBinding" 
                  bindingConfiguration="MyMsmqBinding" contract="ManageContactService.IManageContact" />

        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />

      </service>
    </services>
    <bindings>
      <netMsmqBinding>
        <binding name="MyMsmqBinding">
          <security mode="None"></security>
        </binding>
      </netMsmqBinding>
    </bindings>
    <behaviors>
      <serviceBehaviors>
        <behavior name="ContactServiceBehavior">
          <serviceMetadata httpGetEnabled="true"/>
          <serviceDebug includeExceptionDetailInFaults="False"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>
  </system.serviceModel>
4

1 回答 1

2

你需要一个冒号:

net.msmq://localhost/private/testqueue

于 2013-09-12T15:02:58.187 回答