user222427
user222427

Reputation:

Could not find default endpoint element that references contract

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.

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" (is the original state)

Code that calls the contract:

using (FindingServicePortTypeClient client = new FindingServicePortTypeClient())

Upvotes: 1

Views: 12890

Answers (1)

user595010
user595010

Reputation:

The rest of the error message is:

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.

Upvotes: 4

Related Questions