找不到引用合同的默认端点元素 [英] Could not find default endpoint element that references contract

查看:59
本文介绍了找不到引用合同的默认端点元素的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个从服务运行的eBay控制台应用程序。如果我按原样运行控制台,则可以正常运行。如果我不运行它,则会在 ServiceModel中得到找不到引用合同'EbayFinding.FindingServicePortType 的默认端点元素 code>客户端配置部分。

I created an eBay console app that runs from a service. If I run the console as is, it works fine. If I don't run it as it I get 'Could not find default endpoint element that references contract 'EbayFinding.FindingServicePortType' in the ServiceModel client configuration section.

我已经尝试了完全限定我的 app.config 的资格,但是没有似乎无法解决问题,有人有什么想法吗?

I've tried fully qualifying my app.config but that didn't seem to fix it, does anybody have any ideas?

 <endpoint address="https://svcs.ebay.com/services/search/FindingService/v1"
            binding="basicHttpBinding" bindingConfiguration="FindingServiceSOAPBinding"
            contract="EbayFindingConsole.EbayFinding.FindingServicePortType" name="FindingServiceSOAPPort" />
    </client>

contract = FindingServicePortType (是

调用合同的代码:

using (FindingServicePortTypeClient client = new FindingServicePortTypeClient())


推荐答案

其余错误消息是:


这可能是因为没有为您的应用程序找到配置文件,或者是因为没有可以在客户端元素中找到与该合同匹配的终结点元素。

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.

由于直接运行时它可以工作,因此可以排除该终结点不见了。
唯一剩下的就是配置文件不在搜索位置。

Since it is working when run directly, we can rule out that endpoint is missing. The only thing that remains is that configuration file is not where it is being searched for.

检查运行控制台应用程序的目录是否具有

Check whether the directory from which you are running the console app has the configuration file for console app.

如果控制台应用程序和服务可执行文件位于同一目录中,则该目录应包含控制台应用程序配置文件。

If the console app and service executable are in same directory, that directory should contain the console app configuration file.

这篇关于找不到引用合同的默认端点元素的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆