Question

I want to access apis which i got from a wsdl file. I add the reference to this API in dll which is created using C#.

The dll which I created is accessed in another C# exe. When i try to access the API it is giving the following exception

System.InvalidOperationException: Could not find default endpoint element that references contract 'ApiService' 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.

Can anybody tell me what the error is

Was it helpful?

Solution

It seems you are trying to use WCF. WCF's endpoints need configuration placed in serviceModel element of your app.config. You need to add it. here is the sample.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top