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())
The rest of the error message is:
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.