Multi-threaded code can be difficult to debug. Timers fire on another thread so effectively your code is multi-threaded. If you update any sort of UI or main thread controls it's easy to create exceptions. Make sure the data you're working with is thread safe.
The other thing is if an exception occurs on the non-main thread, .NET just eats that exception. So if something goes wrong in your timer code and you're not capturing the error in the timer's execution then the error just disappears without notice. If you have exception handling and you want to capture errors make sure you do it INSIDE of the timer code and then log that.
Hope this helps,
+++ Rick ---
>Hi
>I am using C# .NET 3.5 to develop my windows service. It is customized task scheduler. I have code to write log to text file for every threading.timer event fired. I have problem that, my windows service would freeze after run sometime. From my log, the last logging was executed few days ago. I try to restart it and it working fine again. I have TRY...CATCH... to capture all exception but no exception captured.
>
>Recently, I added more code to log, but this time to event viewer. The weird thing is, it is working till today.
>
>Any ideas?
>
>Thank you