static void Main(string[] args) { _config = (new ServiceConfigurationManager()).GetServiceConfiguration(); var serviceName = "NBNAutoImportService"; //configure logging Log4NetConfiguration.Configure(_config, serviceName); HostFactory.Run(x => { x.UseLog4Net(); x.Service <PollingService>(s => { s.ConstructUsing(name => new PollingService()); s.WhenStarted(ps => ps.Start()); s.WhenStopped(ps => ps.Stop()); }); x.RunAsLocalSystem(); x.SetDescription( "Periodically checks for new NBN import files and runs the importer to ingest them."); x.SetDisplayName("NBN Automatic import service"); x.SetServiceName(serviceName); x.BeforeInstall(EnsureConfiguration); }); }
static AutoRollbackDatabaseTest() { Log4NetConfiguration.Configure(); }