Click here to Skip to main content
15,903,201 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
C#
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();
Posted
Comments
Member 11773323 7-Dec-15 4:37am    
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.

Did you copy the configuration file with your exe to the machine?
Member 11898992 7-Dec-15 4:39am    
yes
Member 11773323 7-Dec-15 4:45am    
Did you shut off the fire wall?
Member 11898992 7-Dec-15 4:52am    
I am not sure about that, i have to check since its a server machine
Member 11898992 7-Dec-15 5:03am    
how will shutting off the fire wall make difference?
and i cant change it as i don't have rights to change windows firewall in server machine. i am seeing it is not recommended by windows, so any other way?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900