BUG: The Elapsed event of the System.Timers.Timer class is not raised in a Windows service (842793)
The information in this article applies to:
- Microsoft .NET Framework 1.1
- Microsoft .NET Framework 1.0
SYMPTOMSYou 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.CAUSENote 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.WORKAROUNDTo work around this problem, obtain the hotfix in the following Microsoft Knowledge Base article: 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. STATUSMicrosoft has confirmed that this is a bug in the Microsoft
products that are listed in the "Applies to"
section.REFERENCESFor additional information, visit the following Microsoft
Developer Network (MSDN) Web sites:
Modification Type: | Minor | Last Reviewed: | 2/18/2006 |
---|
Keywords: | kbtshoot kbBug kbSample kbcode kbServiceProcess kbTimer KB842793 kbAudDeveloper |
---|
|