private void btnServer_Click(object sender, EventArgs e) { var message = string.Empty; // Start Application as Server Host = new WcfHost.WcfHost(); ServerForm serverForm = new ServerForm(); serverForm.Init(WcfHost.WcfHost.ServerVM); serverForm.Disposed += ServerForm_Disposed; if (Host.Start(out message)) { this.Hide(); serverForm.Show(); } else { MessageBox.Show(message); } }