Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hello,

 

Is there any special reason, a timer not to work when used in a windows service application?

 

I am using a VB .NET, below is the code of the OnStart method.

 

Protected Overrides Sub OnStart(ByVal args() As String)

Me.Timer1.Interval = 1000

Me.Timer1.Enabled = True

End Sub

 

If you need any more info, please do not hesitate to ask.

 

Thanks,

Aleksandar

Posted

Maybe i'm being very nitpicking but what timer do you use?

There are three versions:

System.Timers.Timer

System.Threading.Timer

System.Windows.Forms.Timer

 

If you're using a System.Windows.Forms.Timer it could be that a windows service application usually doesnt have a UI so there might be something regarding forms that prevent it from working correctly.

Nothing is as illusive as 'the last bug'.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...