Click here to Skip to main content
15,913,486 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi guys, I have a windows service with a couple of different methods, what happens is that I make the method run at a certain time, my timers interval is for every minute.
But I have notices that when I let the service run overnight, the methods does not get called, I know this because it should make text files, appended with the date it was run (which is at 10:00 everyday).

Please advise on what to do, or what might cause this issue.

Thanks guys.
Posted

1 solution

So you've got a windows service that sits there running a timer, checking the time once a minute? If the time is 10:00, then perform some action? Is that correct?

If so, I'd say you've got some error in the way you're checking the time and your code is never being hit. Without seeing the source, it's impossible to say for sure

However, why are you even using a windows service for this? It's a complete waste of resource and an overly complex solution for what you want to achieve.

Just create a console\windows forms app (with no interface) that performs your actions. Then create a scheduled task that runs your application at the specified time - job done!

It's a much simplier approach and you eliminate any possible errors in the timer \ time checking side of things - thats what the task scheduler is doing for you.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900