static void Main() { // instantiate the controller MainForm form = new MainForm(); // publish the controller to the remoting system TcpChannel channel = new TcpChannel(1175); ChannelServices.RegisterChannel(channel, false); RemotingServices.Marshal(form, "controller.rem"); // hand over to the controller form.StartApplication(); // the application is finishing - close down the remoting channel RemotingServices.Disconnect(form); ChannelServices.UnregisterChannel(channel); }