Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Windows Service starts then stops automatically

I have a solution that has three projects. One is a service, one is a form, and one is a class library.

I use the form for debugging, my logic is complete now I would like to just call.

Protected Overrides Sub OnStart(ByVal args() As String)
    Dim Logic As New ProcessMail
    workTimer = New Timer(New TimerCallback(AddressOf Logic.ProcessMessages), Nothing, (1000 * 60 * 10), (1000 * 60 * 10))
    MyBase.OnStart(args) 
End Sub

So it fires off my code every 10 minutes. Why wont this work?

The service installs, I see it but it starts and stops, can anyone help me out with what I am doing wrong?

like image 201
Keith Beard Avatar asked Jul 22 '11 19:07

Keith Beard


1 Answers

Check the event log. Frequently, a windows service will stop because an exception is thrown.

like image 108
Eric J. Avatar answered Oct 12 '22 21:10

Eric J.