Пример #1
0
        protected override void OnStart(string[] args)
        {
#if DEBUG
            System.Diagnostics.Debugger.Launch();
#endif
            commandLineProcessor = new CommandLineProcessor();
            backgroundTask       = Task.Factory.StartNew(() => {
                var options = WindowsServiceUtilities.GetOptionsFromFile();
                commandLineProcessor.EntryPoint(args, overrideOptions: options);
            }, TaskCreationOptions.LongRunning);
        }
Пример #2
0
        static void Main(string[] args)
        {
            if (args.ToList().Contains(WindowsServiceUtilities.RUN_AS_SERVICE_TOKEN))
            {
#if DEBUG
                Debugger.Launch();
#endif
                WindowsServiceUtilities.RunService();
            }
            else
            {
                var commandLineProcessor = new CommandLineProcessor();
                commandLineProcessor.EntryPoint(args);
            }
        }