protected override void OnStop() { try { m_daemon.Stop(); } catch (Exception excp) { StreamWriter errorLog = new StreamWriter(DEFAULT_SHUTDOWNERRORLOG_PATH, true); errorLog.WriteLine(DateTime.Now.ToString("dd MMM yyyy HH:mm:ss") + " Exception Stopping Service. " + excp.Message); errorLog.Close(); } }