An endpoint configuration section for contract "serviceReferenc.service" could not be loaded

场景:有一个WCF应用,添加服务引用后,自动生成一个app.config文件,当调用WCF时,它抛出一个错误:app

An endpoint configuration section for contract 'ServiceReference1.Service' could not be loaded because more than one endpoint configuration for that contract was found. Please indicate the preferred endpoint configuration section by name.blog

 

解决方案:io

  1. 打开app.config文件,你能够看到<client> 标签下有2 个endpoint (由于你的WCF配置文件里定义了2个endpoint, 若是在WCF 配置文件里删除一个endpoint, 此时添加服务引用后它将生成一个)

  

  

 

  2. 删除其中一个endpointcli

相关文章
相关标签/搜索