public Main() { g_oBatman = new BatchManager(); try { string sSetupXMLPath = AppSettings.App_Path() + AppSettings.App_Name() + "Setup.xml"; Logging.LogMessage("Constructor::SetupXMLPath, " + sSetupXMLPath); XMLSettings.LoadBaseSettings(sSetupXMLPath); XMLSettings.LoadDefaults(sSetupXMLPath); g_oBatman.NewBatchProcess += G_oBatman_NewBatchProcess; } catch (Exception ex) { // Unable to write to log when the error can not find the workingPath Logging.LogMessage(String.Format("Exception: {0}, occured in {1}: {2}", ex.InnerException, ex.TargetSite, ex.Message)); } InitializeComponent(); }
public batchService() { g_oBatman = new BatchManager(); timer.Interval = 60000; timer.Elapsed += Timer_Elapsed;; timer.Enabled = true; try { string sSetupXMLPath = AppSettings.App_Path() + AppSettings.App_Name() + "Setup.xml"; Logging.LogMessage("Constructor::SetupXMLPath, " + sSetupXMLPath); Logging.WriteToEventLog("Constructor::SetupXMLPath, " + sSetupXMLPath); XMLSettings.LoadBaseSettings(sSetupXMLPath); XMLSettings.LoadDefaults(sSetupXMLPath); } catch (Exception ex) { Logging.WriteToEventLog(String.Format("Exception: {0}, occured in {1}: {2}", ex.InnerException, ex.TargetSite, ex.Message), "batchService", EventLogEntryType.Error); // Unable to write to log when the error can not find the workingPath //LogMessage(String.Format("Exception: {0}, occured in {1}: {2}", ex.InnerException, ex.TargetSite, ex.Message)); } InitializeComponent(); }