我正在尝试运行一个将参与分布式事务的 WCF Web 服务。我不断收到以下错误消息...
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
这是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" />
谁能看到这有什么问题?这让我疯狂!
谢谢
皮特
最佳答案
您在这里指的是自定义绑定(bind):
<service name = "DistServiceX">
<endpoint
address=""
binding="myBinding"
contract="IDistService" />
但是,没有称为
myBinding
的自定义绑定(bind)。配置中的任何位置。我假设你真的想引用
wsHttpBinding
和 myBinding
绑定(bind) 配置您在配置文件中指定的。此外:服务的名称必须与实现服务的类的完全限定名称匹配 - 包括命名空间(以及:由该服务实现并在给定端点上公开的契约(Contract)的名称必须包括任何命名空间):<service name="YourNamespace.DistServiceX">
<endpoint
address=""
binding="wsHttpBinding"
bindingConfiguration="myBinding"
contract="YourNamespace.IDistService" />
关于wcf - 找不到配置绑定(bind)扩展,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3918696/