我正在尝试运行将参与分布式事务的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" />
有人能看出这有什么问题吗?这让我发疯了!
由于
皮特
答案 0 :(得分:11)
您指的是自定义绑定:
<service name = "DistServiceX">
<endpoint
address=""
binding="myBinding"
contract="IDistService" />
但是,您的配置中没有任何名为myBinding
的自定义绑定。
我假设你真的想要引用你在配置文件中指定的wsHttpBinding
和myBinding
绑定配置。此外:服务的名称必须与实现服务的类的完全限定名称相匹配 - 包括命名空间(以及:该服务实现并在给定端点上公开的合同的名称必须包含任何名称空间): / p>
<service name="YourNamespace.DistServiceX">
<endpoint
address=""
binding="wsHttpBinding"
bindingConfiguration="myBinding"
contract="YourNamespace.IDistService" />