【问题标题】:Configuration binding extension could not be found找不到配置绑定扩展
【发布时间】:2011-04-24 12:55:57
【问题描述】:

我正在尝试让 WCF Web 服务运行,该服务将参与分布式事务。我不断收到以下错误消息...

找不到配置绑定扩展“system.serviceModel/bindings/myBinding”。验证此绑定扩展是否已在 system.serviceModel/extensions/bindingExtensions 中正确注册,并且拼写正确

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

谁能看出这有什么问题?快把我逼疯了!

谢谢

皮特

【问题讨论】:

    标签: wcf distributed-transactions


    【解决方案1】:

    您在这里指的是自定义绑定:

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

    但是,您的配置中的任何位置都没有名为 myBinding 的自定义绑定。

    我假设您确实想引用您在配置文件中指定的wsHttpBindingmyBinding 绑定配置。此外:服务的名称必须与实现服务的类的完全限定名称匹配 - 包括命名空间(并且:由该服务实现并在给定端点上公开的合同的名称必须包括任何命名空间):

    <service name="YourNamespace.DistServiceX">
       <endpoint
           address=""
           binding="wsHttpBinding" 
           bindingConfiguration="myBinding"
           contract="YourNamespace.IDistService" />
    

    【讨论】:

    • 你是对的。此外,尽管我还必须使用命名空间来完全质量 IDistService 接口,并指定实现类的 namespace.class 而不是“DistServiceX”
    • 嗨,马克。你能把它包括在你的回复中吗?回复完成后,我可以接受它作为答案。如果在接受的答案中提到了配置的所有问题,它将对其他人更有帮助。
    • 谢谢!作为一名前端开发人员,我一直在努力用谷歌搜索这个问题,但你解释得很好。
    猜你喜欢
    • 2013-08-16
    • 2013-09-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-06-07
    相关资源
    最近更新 更多