Run a windows service monthly and quarterly

Last Reply 19 hours ago By rani

Posted 4 days ago

I refered the code on


But I am facing problem when I schedule my service monthly and quarterly as it is throwing error at 

 //Get the difference in Minutes between the Scheduled and Current Time.
    int dueTime = Convert.ToInt32(timeSpan.TotalMilliseconds);
Because  TotalMilliseconds exceeds the max value of int. So, I used long datatype but then also the scheduler is not set properly. Please suggest me the correct way.
Thanks in advance.
You are viewing reply posted by: Indresh 4 days ago.
Posted 4 days ago Modified on 4 days ago

Hi SheetalD,

You need to change your Convert.ToInt32 to below code.




I agree, here is the link: