找不到配置绑定扩展

发布于 2024-09-27 20:03:24 字数 1050 浏览 0 评论 0原文

我正在尝试运行 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" />

任何人都可以看到这有什么问题吗?这让我发疯!

谢谢皮特

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

呆萌少年 2024-10-04 20:03:24

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

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

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

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

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

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" />
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文