private static void Main(string[] args) { #if DEBUG // Run debugger System.Diagnostics.Debugger.Launch(); #endif InitializeContainer(); using var handler = new SingleTaskServiceHandler <Worker>(IocRegistrations.Configuration) .SubscribeLog(); if (!handler.Start(args)) { RunAsAConsoleApplication(); } }
private static void Main(string[] args) { //-:cnd:noEmit #if DEBUG // Run debugger System.Diagnostics.Debugger.Launch(); #endif //+:cnd:noEmit // IOC container setup IocRegistrations.Register().Verify(); using var handler = new SingleTaskServiceHandler <Worker>(IocRegistrations.Configuration) .SubscribeLog(); if (!handler.Start(args)) { // One-time launch of user code without the windows-service hosting RunAsAConsoleApplication(); } }