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

1

7

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'] 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>
Goldthread answered 14/3, 2011 at 6:22 Comment(3)
Check out Tom Hollander's three part blog post series on how to get MSMQ, IIS and WCF to work nicely together. I personally typically create MSMQ configuration manually and just share the common interfaces as a common assembly between server and clientPetronel
thanks for the reply, i have read Tom Hollanders blog but still cant work it outGoldthread
Were you able to get it working? I'm having the exact same issue in my project. Trying to add a service reference to a service app and I'm getting the same issue. My web.config looks almost identical to yours as well.Surveillance
S
6

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

Subternatural answered 27/12, 2013 at 12:2 Comment(1)
And 3, add the net.msmq binding to the IIS site. The binding Information field should be the name of the machine.Pyrene

© 2022 - 2024 — McMap. All rights reserved.