Tags: | Categories: Blog Posted by admin on 3/9/2009 5:54 PM | Comments (4)

Once again after a year I found code for a windows service using System.Timers.Timer, and guess what, it does not work ... again ... duh. So after all these resources telling you, don't do it:



There are people that still use it for services. To all this people, please use System.Threading.Timer in 2.0 don't do it in 1.1. I believe there is still a bug assign to that one:


Also, please rememeber that System.Threading.Timer  is not thread safe, even being on the Threading namespace is not thread safe, so real this awesome article from Alex Calvo for a safe service programming ;-)


Hope this helps people to debug why their service stops calling the TimeElapsed function and why is not every X seconds.



blog comments powered by Disqus