public void TestClientForm_Load(object sender, EventArgs e) { var callback = new TestCallback(); var context = new InstanceContext(callback); var pipeFactory = new DuplexChannelFactory <ITestService>(context, new NetNamedPipeBinding(), new EndpointAddress("net.pipe://localhost/Test")); service = pipeFactory.CreateChannel(); service.Connect(); }