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

相關文章
相關標籤/搜索