using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace CardReaderService { internal static class ConfigureService { internal static void Configure() { //try //{ // HostFactory.Run(configure => // { // configure.Service(service => // { // service.ConstructUsing(s => new Service1()); // service.WhenStarted(s => s.Start()); // service.WhenStopped(s => s.Stop()); // }); // //Setup Account that window service use to run. // configure.RunAsLocalSystem(); // configure.SetServiceName("MyWindowServiceWithTopshelf"); // configure.SetDisplayName("MyWindowServiceWithTopshelf"); // configure.SetDescription("My .Net windows service with Topshelf"); // }); //} //catch (Exception ex) //{ // throw; //} } } }