can any one please check what i am doing onstart is correct or not please. i am getting error service started and stopped automatically. i want to run my service every 10 minutes. please help its been 4 hours i am struggling
protected override void OnStart(string[] args)
{
try
{
_aTimer.Start();
_aTimer.Enabled = true;
_aTimer = new System.Timers.Timer(10 * 60 * 1000);//10 minutes
_aTimer.AutoReset = true;
_aTimer.Elapsed += new System.Timers.ElapsedEventHandler(_aTimer_Elapsed);
}
catch(Exception ex) {
RMLogger.RMException("ServiceManager", this.GetType().Name.ToString(), ex.ToString());
}
}