Configuration binding extension could not be found

Peter Morris picture Peter Morris · Oct 12, 2010 · Viewed 31.8k times · Source

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

Answer

marc_s picture marc_s · Oct 12, 2010

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