WCF入门-项目间调用服务
练习WCF入库,添加了一个WCF项目,同时添加了一个控制台程序,在控制台程序启动时,调用WCF服务,报错。

控制台程序代码为:
namespace WcfConsumer
{
class Program
{
static void Main(string[] args)
{
using (ServiceHost serviceHost = new ServiceHost(typeof(testService))) {
serviceHost.Open();
Console.WriteLine("WCF Service has started...");
Console.ReadLine();
serviceHost.Close();
}
Console.WriteLine("The WCF Service has stopped...");
}
}
}

浙公网安备 33010602011771号