Esempio n. 1
0
        public static void Main(string[] args)
        {
            if (args != null && args.Length > 0)
            {
                if (args[0].Equals("/service", StringComparison.InvariantCultureIgnoreCase))
                {
                    LoggingConfig.ConfigureConsole();

                    Log.Info("Running Lockdown Host.");
                    Log.Info("To install host as windows service run with /install argument.");

                    var host = new AuthzServiceHost();
                    host.Start();

                    Log.Info("Host Started.");

                    do
                    {
                        Thread.Sleep(60000);
                    } while (true);
                }
            }

            var services = new ServiceBase[] { new WindowsServiceHost() };
            ServiceBase.Run(services);
        }
 protected override void OnStart(string[] args)
 {
     base.OnStart(args);
     _host = new AuthzServiceHost();
     _host.Start();
 }