public static void Main(string[] args) { WebServerServiceProvider server = new WebServerServiceProvider(); server.StartService(); Console.ReadKey(); server.StopService(); }
/// <summary> /// Start Service /// </summary> /// <param name="args"></param> protected override void OnStart(string[] args) { try { serviceHost = new WebServerServiceProvider(); serviceHost.StartService(); EventLog.WriteEntry("Web Service Started", EventLogEntryType.Information); } catch (Exception e) { EventLog.WriteEntry("Web Service Start ERR. " + e.Message, EventLogEntryType.Error); } }