Example #1
0
        protected override void OnStart(string[] args)
        {
            _logger.Information("Service starting...");

            // Start the main process of your service here.
            _serviceRunner.Start();

            _logger.Information("...service started.");
        }
Example #2
0
        /// <summary>
        ///     The main entry point for the application.
        /// </summary>
        private static void Main()
        {
#if DEBUG
            var serviceRun = new ServiceRun();
            serviceRun.Start();
            while (!Console.KeyAvailable)
            {
            }
            serviceRun.Stop();
            Console.WriteLine(@"bye bye");
#else
            var servicesToRun = new ServiceBase[]
            {
                new WrapperService()
            };
            ServiceBase.Run(servicesToRun);
#endif
        }