title: Could not find default endpoint element that references contract
body: <p>I have self hosted a WCF service from a console application (HOST). I am calling HOST  from another console application (PARENT). When I run PARENT, everything works fine like the WCF hosted successfully and instance of service reference is also getting created. The PARENT application is actually a plug-in for another big unmanaged application(BIG A). When I start the PARENT application from BIG A , the console application self hosts the service successfully. However I am getting following error while creating the instance of service.</p>
  
  <p>Could not find default endpoint element that references contract 'CalculatorServiceReference.ICalculatorService' 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.</p>
  
  <p>The configuration files are as follows.</p>
  
  <p>•Configuration file of HOST </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt;    
  &lt;configuration&gt;    
   &lt;system.serviceModel&gt;    
   &lt;behaviors&gt;    
   &lt;serviceBehaviors&gt;    
   &lt;behavior name="NewBehavior"&gt;    
   &lt;serviceMetadata httpGetEnabled="true" httpsGetEnabled="false" /&gt;    
   &lt;/behavior&gt;    
   &lt;/serviceBehaviors&gt;    
   &lt;/behaviors&gt;    
   &lt;services&gt;    
   &lt;service behaviorConfiguration="NewBehavior" name="HybridCalcService.CalculatorService"&gt;    
   &lt;clear /&gt;    
   &lt;endpoint address="mex" binding="mexHttpBinding" name="Mex" contract="IMetadataExchange" 
   listenUriMode="Explicit"&gt;    
   &lt;/endpoint&gt;    
   &lt;endpoint address="net.tcp://localhost:8523/CalcService" binding="netTcpBinding"    
   name="Tcp" contract="HybridCalcService.ICalculatorService" listenUriMode="Explicit"&gt;
  
   &lt;/endpoint&gt;
  
   &lt;endpoint address="HTTP" binding="basicHttpBinding" bindingConfiguration=""    
   name="HTTP" contract="HybridCalcService.ICalculatorService" /&gt;    
   &lt;host&gt;
  
   &lt;baseAddresses&gt;    
   &lt;add baseAddress="http://localhost:8080/Hybridservice" /&gt;    
   &lt;/baseAddresses&gt;    
   &lt;/host&gt;    
   &lt;/service&gt;    
   &lt;/services&gt;       
   &lt;/system.serviceModel&gt;    
  &lt;/configuration&gt;
  </code></pre>
  
  <p>•And the config of PARENT is </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt;    
  &lt;configuration&gt;    
   &lt;system.serviceModel&gt;    
   &lt;behaviors&gt;    
   &lt;serviceBehaviors&gt;    
   &lt;behavior name="NewBehavior"&gt;    
   &lt;serviceMetadata httpGetEnabled="true" httpsGetEnabled="false" /&gt;    
   &lt;/behavior&gt;    
   &lt;/serviceBehaviors&gt;    
   &lt;/behaviors&gt;    
   &lt;services&gt;
  
   &lt;service behaviorConfiguration="NewBehavior" name="HybridCalcService.CalculatorService"&gt;    
   &lt;clear /&gt;    
   &lt;endpoint address="mex" binding="mexHttpBinding" name="Mex" contract="IMetadataExchange"   
   listenUriMode="Explicit"&gt;    
   &lt;/endpoint&gt;    
   &lt;endpoint address="net.tcp://localhost:8523/CalcService" binding="netTcpBinding"    
   name="Tcp" contract="HybridCalcService.ICalculatorService" listenUriMode="Explicit"&gt;    
   &lt;/endpoint&gt;    
   &lt;endpoint address="HTTP" binding="basicHttpBinding" bindingConfiguration=""    
   name="HTTP" contract="HybridCalcService.ICalculatorService" /&gt;    
   &lt;host&gt;    
   &lt;baseAddresses&gt;    
   &lt;add baseAddress="http://localhost:8080/Hybridservice" /&gt;
   &lt;/baseAddresses&gt;    
   &lt;/host&gt;    
   &lt;/service&gt;    
   &lt;/services&gt;    
   &lt;/system.serviceModel&gt;    
  &lt;/configuration&gt;
  </code></pre>
  
  <p>Can anyone help me in this issue?</p>