I refered the code on https://www.aspsnippets.com/Articles/Simple-Windows-Service-that-runs-periodically-and-once-a-day-at-specific-time-using-C-and-VBNet.aspx
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.