How to run a WCF project locally?
Solution 1:
This error simply means you have not set any start up project for WCF project. Try to set service host project as start up project if there is any. If you dont have any of them try to make service host project locally and add a reference to that project in your service host project.
A simple console hosting project will look like this
using System.ServiceModel;
namespace WcfDemoHost
{
class Program
{
static void Main(string[] args)
{
try
{
ServiceHost svchost = new ServiceHost(typeof(yourServiceClassNameHere));
svchost.Open();
Console.WriteLine("Service Started");
Console.ReadLine();
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
}
}
}
there are also several method for hosting WCF services locally like hosting in Windows service, IIS, Console, in windows form etc.You also need to add App.config file for configuring your service like service endpoint and many things. I am providing you some youtube tutorial link that will help you a lot in understanding WCF. I hope this tutorial will help you a lot.
https://www.youtube.com/watch?v=QmfPmqMk9Xs&list=PL6n9fhu94yhVxEyaRMaMN_-qnDdNVGsL1
Go from part 3 and for hosting follow tutorial 24-30.