构建一个简单的WCF应用

步骤一:构建整个解决方案

通过vs2015创建一个名称为WcfService空白的解决方案 

添加4个项目

Service.Interface:定义服务契约(Service Contract)的类库项目,引用System.ServiceModel.dll。

Service:用于定义服务类型的类库项目,由于服务类型需要实现定义在Service.Interface中相应的契约接口,因此该项目具有对Service.Interface项目的引用。

Hosting:作为服务宿主的控制台应用。该项目同时引用Service.Interface、Service项目和System.ServiceMode.dll程序集。

Client:一个控制台应用模拟服务的客户端,该项目引用System.ServiceMode.dll程序集。

步骤二:创建服务契约

原文地址:https://www.cnblogs.com/lijinping321/p/7101115.html