Search code examples
wcfdistributed-transactions

Configuration binding extension could not be found


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


Solution

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