Let me tell you my project structure, my service is called by one of the class library project which is in turn called by my client app which is an addin to outlook.here both my class library and client project has same binding configuration. Note - when i am running the code locally i am not getting this error but when i am deploying it to some other machine (or in server) it is throwing this error.
its almost a week since i am facing this issue, please help me out . Thanks in advance.
Error:
Could not find default endpoint element that references contract 'CreateContactService.ICreateContactService' 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.
App.Config :
<pre lang="text"><pre lang="text">
<configuration>
<system.servicemodel>
<bindings>
<basichttpbinding>
<binding name="BasicHttpBinding_ICreateContactService" closetimeout="00:20:00" opentimeout="00:20:00" receivetimeout="00:20:00" sendtimeout="00:20:00" bypassproxyonlocal="false">
maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647">
<security mode="None">
<transport clientcredentialtype="None" proxycredentialtype="None" realm=""> <message clientcredentialtype="UserName" algorithmsuite="Default">
<client>
<endpoint address="http://vmsrvweba:8080/CreateContactService.svc">
binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_ICreateContactService"
contract="CreateContactService.ICreateContactService"
name="BasicHttpBinding_ICreateContactService" />
<behaviors>
<endpointbehaviors>
<behavior name="ContactSyncEndPointBehavior">
<!-- To avoid disclosing metadata information,
set the value below to false and remove the metadata endpoint above before deployment -->
<!-- To receive exception details in faults for debugging purposes,
set the value below to true. Set to false before deployment
to avoid disclosing exception information -->
<datacontractserializer maxitemsinobjectgraph="2147483647">
<servicebehaviors>
<behavior name="ContactSyncBehavior">
<!-- To avoid disclosing metadata information,
set the value below to false and remove the metadata endpoint above before deployment -->
<servicethrottling maxconcurrentcalls="200" maxconcurrentinstances="200" maxconcurrentsessions="200">
<servicemetadata httpgetenabled="True">
<!-- To receive exception details in faults for debugging purposes,
set the value below to true. Set to false before deployment
to avoid disclosing exception information -->
<servicedebug includeexceptiondetailinfaults="true">
<datacontractserializer maxitemsinobjectgraph="2147483647">
C# code calling service method
private static CreateContactServiceClient _GetClientService = default(CreateContactServiceClient);
_GetClientService = new CreateContactServiceClient();
List<contact> contactsFromDb = new List<contact>();
contactsFromDb = getClientServices.GetContacts();