






















转:http://support.microsoft.com/?scid=kb%3Ben-us%3B842793&x=13&y=8
You can use the Microsoft .NET Framework to create a new Microsoft Windows service that contains a System.Timers.Timer object. When you run this new Windows service, the Elapsed event of the System.Timers.Timer class may not be raised.
Note In this section, the System.Timers.Timer object is referred to as the Timer object.
In the event handler for the Elapsed event of the Timer object, if you call the Stop method of the Timer object, the reference to the Timer object is lost. The garbage collector then reclaims the memory that is associated with the Timer object. Later, even if you call the Start method of the Timer object to raise the Elapsed event, the call does not work. The Elapsed event is not raised.
To work around this problem, obtain the hotfix in the following Microsoft Knowledge Base article:
900822 (http://support.microsoft.com/kb/900822/) FIX: When a .NET Framework based application uses the System.Threading.Timer class, the timer event may not be signaled in the .NET Framework 1.1 S900822
Additionally, use a System.Threading.Timer object instead of the System.Timers.Timer object.
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。