private bool SetupWCFService()
        {
            if (!Server.Instance.IsWCFEnabled)
            {
                return(true);
            }

            ServiceHost selfHost = null;

            try
            {
                selfHost = Server.CreateServiceHost(typeof(PluginService), typeof(IPluginServiceContract), "Plugin/", "PluginService");
                selfHost.Open();
            }
            catch (CommunicationException ex)
            {
                LogManager.ErrorLog.WriteLineAndConsole("An exception occurred: " + ex.Message);
                if (selfHost != null)
                {
                    selfHost.Abort();
                }
                return(false);
            }

            return(true);
        }
Beispiel #2
0
        private static void SetupWcfService( )
        {
            if (!Server.Instance.IsWCFEnabled)
            {
                return;
            }

            ServiceHost selfHost = null;

            try
            {
                selfHost = Server.CreateServiceHost(typeof(PluginService), typeof(IPluginServiceContract), "Plugin/", "PluginService");
                selfHost.Open( );
            }
            catch (CommunicationException ex)
            {
                LogManager.ErrorLog.WriteLineAndConsole(string.Format("An exception occurred: {0}", ex.Message));
                if (selfHost != null)
                {
                    selfHost.Abort( );
                }
            }
        }