public Service() { try { InitializeComponent(); _vaultScanner = new VaultScanner(); _workerThread = new Thread(_vaultScanner.StartScan); } catch (Exception e) { Log.Fatal("Failed to start service", e); throw e; } }
public static void Main(String[] args) { InitializeCommon(); if (args.Count() == 0) { Log.Info("Starting service"); ServiceBase[] ServicesToRun; ServicesToRun = new ServiceBase[] { new Service() }; ServiceBase.Run(ServicesToRun); } else { Log.Info("Starting"); VaultScanner _vaultScanner = new VaultScanner(); _vaultScanner.StartScan(); } }