I am getting below exception when I try to host a WCF service:
Service 'WcfServiceLibrary3.Service1' 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 am using the folowing code:
using (System.ServiceModel.ServiceHost host = new System.ServiceModel.ServiceHost(typeof(WcfServiceLibrary1.Service1)))//Line 1
{
host.Open();
Console.WriteLine("Service started. press any key to stop it");
Console.ReadLine();
host.Close();
}
This error come at line 1. Can anyone help to resolve this Exception.