2005-01-20 17:28:42 UTC
I have developed a windows service using the windows service project
template in VS.NET. I have used three controls in the service, a timer,
performance counter and a message queue control. The service will "sleep"
for 'n' seconds using the timer control and whenever the timer_elapsed event
occurs, I use the performance counter object to determine availability of
few resources. Based on the availability of resources, I use the message
queue control to put messages into a local private queue. The service uses
LocalService account and reads a few registry keys in the OnStart() method
and then waits for the timer_elapsed event.
The issue is the all too familiar "it works on my system" kind!! It works
perfectly fine in my development system (installed using installutil) which
is a WinXP SP2 with .Net 1.1.4322 and the timer also gets triggered
properly. But when I install the same service in a Windows 2003 server the
timer never gets triggered!! The server also has the same version of .Net
framework but I'm just lost as to why the timer doesn't get triggered
there!! There are no errors/warnings generated in the event log too so its
all the more confusing. I also tried creating a setup project with custom
actions and then installed the same in the Win2003 server but the
timer_elapsed event never gets triggered!!
Replies will be very helpful!! Btw, I have set the AutoReset property of
the timer control to false to have control over when the timer starts
ticking again, but I have made sure that I start off the timer