简体   繁体   中英

WCF, MSMQ - the protocol 'net.msmq' is not supported

I am getting the error "the protocol 'net.msmq' is not supported" when I try and add a service reference to my WCF service in visual studio.

I have successfully ran appcmd set site "Default Web Site" -+bindings.[protocol='net.msmq',bindingInformation='localhost'] appcmd set site "Default Web Site" -+bindings.[protocol='net.msmq',bindingInformation='localhost'] and I can see the configuration in the applicationHost.config file. Since I am running my service in visual studio, do I need to enable the net.msmq protocol for my specific application (appcmd set app "Default Web Site/MsmqService" /enabledProtocols:net.msmq)? Im not sure how to do this since my service is running in visual studio? If i dont need to do this, what else could be the issue. Here is my config. Any help appreciated..

<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>

You need to enable the component "Microsoft Message Queue (MSMQ) Server" (1) and add "net.MSMQ" protocol in your application on IIS (2).

  1. Go to "Program and Features" in "Turn Windows features on or off" checked components under "Microsoft Message Queue (MSMQ) Server".

  2. Go to application on IIS, click "Advanced Settings" then "Enabled Protocols" add this ",net.MSMQ".

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM