//start the windows service protected override void OnStart(string[] args) { if (server != null && server.IsRunning) { server.Stop(); } server = new Server(); server.Start(); }
static void Main(string[] args) { try { Server server = new Server(); server.Start(); Console.WriteLine("AudioService OK"); } catch (Exception ex) { Console.WriteLine(ex.Message); } Console.ReadLine(); }