I have a class library, which calls into a Webservice. When i try and instantiate a new instance of the client, I am being thrown the following error is VS:
An exception of type 'System.InvalidOperationException' occurred in System.ServiceModel.dll but was not handled in user code
Additional information: Could not find default endpoint element that references contract 'SanctionsCheckingService.ISanctionsCheckingService' 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.
My app.config file contains the following, which looks correct:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_ISanctionsCheckingService" />
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://localhost:56200/SanctionsCheckingService"
binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_ISanctionsCheckingService"
contract="SanctionsCheckingService.ISanctionsCheckingService"
name="BasicHttpBinding_ISanctionsCheckingService" />
</client>
</system.serviceModel>
Can anyone point to why this is happening?