先建立wcf类库.会默认生成一些试用代码.如下: public class Service1 { public string GetData(int value) { return string.Format("You entered: {0}", value); } } 寄宿控制台.代码如下 using System.ServiceModel; using WcfServiceLibrary1; ServiceHost serviceHost = new ServiceHost(…
使用管理员权限打开VS2017 2. 创建以下代码进行测试: a) 创建一个空白解决方案 b) 创建三个类库文件 c) IMathService代码如下: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.ServiceModel; using…