日期:2014-05-18 浏览次数:20773 次
ServiceHost[] host = new ServiceHost[]{ emphost, emailHost, orgHost, uploadHost, roleHost, loginUserHost, actionInfoHost, modelActionHost}; Type[] type = { typeof(EmpService), typeof(UserService), typeof(OrgService), typeof(UpLoadService), typeof(RoleService), typeof(LoginUserService), typeof(ActionInfoService), typeof(ModelActionService) }; for (int i = 0; i < host.Length; i++) { host[i] = new ServiceHost(type[i]); //结果为“((System.ServiceModel.Channels.CommunicationObject)(this.emailHost))”为 null //emailHost = new ServiceHost(type[i]);这样子就可以 }