的winform我在VS2010的解決方案,其中包含一些項目:使用WCF在通過類庫
a wcf project a win form project a class library
我的類庫具有參考的WCF服務。當我嘗試使用此引用的檢索winform應用程序從WCF數據提出了這個錯誤:
Could not find default endpoint element that references contract 'MikServiceShopInfo.IshopsService' in the ServiceModel client configuration section. This might be because no configuration file was found for your application, or because no endpoint element matching this contract could be found in the client element.
我改變類庫的app.config到這一點:
<endpoint address="http://localhost:8855/LaptopsInfoService.svc"
binding="basicHttpBinding"
bindingConfiguration="BasicHttpBinding_ILaptopsInfoService"
contract="ILaptopsInfoService"
name="BasicHttpBinding_ILaptopsInfoService" />
<endpoint address="http://localhost:8855/shopsService.svc"
binding="basicHttpBinding"
bindingConfiguration="BasicHttpBinding_IshopsService"
contract="IshopsService"
name="BasicHttpBinding_IshopsService" />
默認情況下存在完全合格的合同名稱。我改變它來解決我的問題。我已經將複製到了我的winapp項目中,但問題仍然存在。 –
2012-07-13 10:02:01