public void GlobalSetup() { var definitionsProvider = new RpcServiceDefinitionsBuilder(); switch (this.ConnectionType) { case RpcConnectionType.Grpc: this.server = new GrpcCore.Server { Services = { SimpleService.BindService(new GrpcSimpleService()) }, Ports = { new GrpcCore.ServerPort("localhost", 50051, GrpcCore.ServerCredentials.Insecure) } }; this.server.Start(); this.channel = new GrpcCore.Channel("127.0.0.1:50051", GrpcCore.ChannelCredentials.Insecure); this.clientService = new SimpleService.SimpleServiceClient(this.channel); break; #if COREFX case RpcConnectionType.NetGrpc: this.host = CreateNetGrpcHost(); host.Start(); var handler = new System.Net.Http.HttpClientHandler(); handler.ServerCertificateCustomValidationCallback = (httpRequestMessage, cert, cetChain, policyErrors) => { return(true); }; var channelOptions = new GrpcNet.Client.GrpcChannelOptions() { HttpClient = new System.Net.Http.HttpClient(handler), DisposeHttpClient = true }; this.channel = GrpcChannel.ForAddress("https://localhost:50051", channelOptions); this.clientService = new SimpleService.SimpleServiceClient(channel); break; #endif } }