private void JoinServer(string username) { // Check State on Service // Make a ChannelFactory Proxy to the Service DuplexChannelFactory <IChatService> cf = new DuplexChannelFactory <IChatService>(this, "NetTcpBinding_IChatService"); cf.Open(); IChatService proxy = cf.CreateChannel(); if (proxy != null) { try { proxy.AddMeToServer(username); Console.WriteLine("Inside join server"); // Disable the GUI for Chat UpdateChatGUI(true); } // end of try catch (FaultException <DuplicateUserFault> ex) { System.Diagnostics.Debug.WriteLine(ex.Detail.Reason, System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Namespace + "." + System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "." + System.Reflection.MethodBase.GetCurrentMethod().Name); MessageBox.Show(ex.Detail.Reason); } catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.Message, System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Namespace + "." + System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name + "." + System.Reflection.MethodBase.GetCurrentMethod().Name); MessageBox.Show("Error logging off user: "******"Cannot Create a Channel to a Proxy. Check Your Configuration Settings.", "Proxy", MessageBoxButtons.OK); } // end of else }