开发者

Windows Service starts then stops automatically

开发者 https://www.devze.com 2023-03-22 03:11 出处:网络
I have a solution that has three projects. One is a service, one is a form, and one is a class librar开发者_如何转开发y.

I have a solution that has three projects. One is a service, one is a form, and one is a class librar开发者_如何转开发y.

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?


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

0

精彩评论

暂无评论...
验证码 换一张
取 消