9

I am trying to get a WCF webservice running which will participate in distributed transactions. I keep getting the following error message...

Configuration binding extension 'system.serviceModel/bindings/myBinding' could not be found. Verify that this binding extension is properly registered in system.serviceModel/extensions/bindingExtensions and that it is spelled correctly

Here is the web.config

  <system.serviceModel>
<services>
  <service name = "DistServiceX">
    <endpoint
       address=""
       binding="myBinding"
       contract="IDistService"
     />
  </service>
</services>
<bindings>
  <wsHttpBinding>
    <binding
      name="myBinding" 
      transactionFlow="true"
      />
  </wsHttpBinding>
</bindings>

<behaviors>
  <serviceBehaviors>
    <behavior name="">
      <serviceMetadata httpGetEnabled="true" />
      <serviceDebug includeExceptionDetailInFaults="false" />
    </behavior>
  </serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />

Can anyone see what is wrong with this? It's driving me crazy!

Thanks

Pete

Peter Morris
  • 20,174
  • 9
  • 81
  • 146

1 Answers1

14

You are referring to a custom binding here:

<service name = "DistServiceX">
   <endpoint
       address=""
       binding="myBinding"
      contract="IDistService" />

However, there is no custom binding called myBinding anywhere in your config.

I assume you really want to refer to a wsHttpBinding and the myBinding binding configuration that you specified in your config file. Furthermore: the name of the service must match the fully qualified name of the class that implements the service - including namespace (and also: the name of the contract being implemented by that service and exposed on a given endpoint must include any namespaces):

<service name="YourNamespace.DistServiceX">
   <endpoint
       address=""
       binding="wsHttpBinding" 
       bindingConfiguration="myBinding"
       contract="YourNamespace.IDistService" />
marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
  • You are correct. In addition though I also had to fully quality the IDistService interface with a namespace and also specify the namespace.class of the implementing class instead of "DistServiceX" – Peter Morris Oct 13 '10 at 10:56
  • Hi Marc. Can you include that in your response? Once the response is complete I can accept it as an answer. It'll just be more helpful for others in future if all of the problems with the config are mentioned in the accepted answer. – Peter Morris Oct 14 '10 at 10:25
  • 1
    THANKYOU! As a front-end developer I was struggling with googling this issue, but you explained it VERY WELL. – Mitchell Currie Jul 06 '13 at 12:35