Window Service w/ timer

  • Thread starter Thread starter UGH
  • Start date Start date
U

UGH

Onstart event, I put timer1.enabled = true.



The timer1 interval is set to 3000 and auto restart is set to true.



On my developer machine, it work fine but on the server it does not work. I
put a print line statement that will print what is going on in the program
to the text file. The text file tells me that the service did start but when
the timer1 elapsed, it does not fire the timer1.elpasted event. Also, the
event view shows that the service started and was running fine. What am I
missing here?



Thanks
 
Also, the
event view shows that the service started and was running fine.

The event view would show you something anyway as long as onStart is fired
to run successfully, but it doesn't mean the service is error free (least in
logic....).
From MSDN sample code:
"
"
AddHandler Timer.Elapsed, Addressof OnTimeEvent
'Set the time interval
"
"
Private Shared Sub OnTimeEvent(ByVal source As Object, ByVal e As
ElapsedEventArgs)
' Do Something when the timer is fired.
End Sub

Above lines are necessary to fire timer and its event.
 
I still don't get it. The timer elapsed event is triggered on the developer
machine but it will not trigger the elapsed event on the server.
 
You did the same I did. You're using the wrong timer object. Look for the
Timer on the Components tab vs the Windows Forms tab

Jeff
 
Back
Top