Ejemplo n.º 1
0
 private void btnStart_Click(object sender, EventArgs e)
 {
     // (re)start the service
     DisposeHelper.SafeDispose(ref _Server);
     _Server = new ServiceHost(_Logger);
     _Server.Start();
 }
Ejemplo n.º 2
0
        protected override void OnStart(string[] args)
        {
            // start the service
            ILogger svcLogger = new ServiceLogger(base.EventLog);

            try
            {
                // - set current directory to the install location
                // - get executable name for file logger
                Environment.CurrentDirectory = AppDomain.CurrentDomain.BaseDirectory;
                ProcessModule pm         = Process.GetCurrentProcess().MainModule;
                string        moduleName = pm.ModuleName.Split('.')[0];
                _loggerRef = Reference <ILogger> .Create(new MultiLogger(
                                                             svcLogger,
                                                             new FileLogger(@"C:\_qds\logs\" + moduleName + ".{dddd}.log")));

                const EnvId env      = EnvId.Dev_Development; // hack
                var         settings = new NamedValueSet(EnvHelper.GetAppSettings(env, EnvHelper.SvcPrefix(SvcId.CoreServer), true));
                DisposeHelper.SafeDispose(ref _server);
                _server = new CoreServer(_loggerRef, settings);
                _server.Start();
            }
            catch (Exception ex)
            {
                svcLogger.Log(ex);
            }
        }
Ejemplo n.º 3
0
        protected override void OnStart(string[] args)
        {
            // - change the current directory to the service installation directory
            //   (required in order to access resource files)
            Environment.CurrentDirectory = AppDomain.CurrentDomain.BaseDirectory;

            // start the service
            _Logger = new FileLogger(@"C:\_qrsc\ServiceLogs\ServiceHostSvc.{dddd}.log");
            _Server = new ServiceHost(_Logger);
            _Server.Start();
        }
Ejemplo n.º 4
0
        private void StartUp()
        {
            // start the service
            string env      = EnvHelper.EnvName((EnvId)cbEnvironment.SelectedIndex);
            var    settings = new NamedValueSet();

            settings.Set(CfgPropName.NodeType, cbServerMode.SelectedIndex);
            settings.Set(CfgPropName.EnvName, env);
            settings.Set(CfgPropName.DbServer, txtDbCfg.Text);
            _coreServer = new CoreServer(_coreLogger, settings);
            _coreServer.Start();
        }