WCF/WF - service has no endpoint - Asked By karur krishna madhu on 06-Aug-13 08:46 AM

Service 'WcfHost.Calservref.CalServiceClient' has zero application (non-infrastructure) endpoints. This might be because no configuration file was found for your application, or because no service element matching the service name could be found in the configuration file, or because no endpoints were defined in the service element
 i have created a wcf service and i am trying to host it in a console env and the app .config has all the details but still i get the error

 ServiceHost host = new ServiceHost(typeof(CalServiceClient));
            Console.WriteLine("Service is Live");
            Console.WriteLine("Press enter to stop the hosted service");

                <binding name="BasicHttpBinding_ICalService" />
            <endpoint address="http://localhost:12911/CalService.svc" binding="basicHttpBinding"
                bindingConfiguration="BasicHttpBinding_ICalService" contract="Calservref.ICalService"
                name="BasicHttpBinding_ICalService" />
        <service name="Calservref.CalService">
          <endpoint address="" binding="basicHttpBinding" contract="Calservref.ICalService">            
          <!-- This Endpoint is used for genertaing the proxy for the client -->
          <!-- To avoid disclosing metadata information, set the value below to false and
       remove the metadata endpoint above before deployment -->
          <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange">            
              <add baseAddress="http://localhost:12911/CalService.svc"/>
          <behavior name="ServiceBehaviour">
            <serviceMetadata httpGetEnabled="false"/>
Robbe Morris replied to karur krishna madhu on 06-Aug-13 05:36 PM
Why are you not creating a new instance of CalServiceClient?

var wcf = new CalServiceClient();
karur krishna madhu replied to Robbe Morris on 07-Aug-13 02:56 AM
Thanks Morris! i found the fix i created service reference instead of creating the reference.