Hi,
I have made changes to a colleague's Windows service and it works fine. It's an email service hosted on our web server.
In almost all functions there are try...catch blocks, such as this one:
The problem is that when the error is caught, the service won't stop and restart (I have set its properties to always restart upon stopping); it just hangs, which might not be so strange as there is really nothing that tells the service to stop (e.g., Me.Stop() or the like).
What do I need to insert before the End Try in order to actually stop/restart the service, if it's at all possible?
I don't want to do a lot of experimenting as I need to do this live and I hope that one of you knows if there is something I can do to accomplish this task. Surprisingly I haven't found anything on the Internet on this subject, but only what to do when an error ISN'T caught.
Warm regards from a snowy Sweden,
Pettrer
I have made changes to a colleague's Windows service and it works fine. It's an email service hosted on our web server.
In almost all functions there are try...catch blocks, such as this one:
VB.NET:
...
Catch ex As Exception
Fellogg("An error has occured in Sendmail" & ex.ToString)
S_AllMail = False
End Try
End Function
The problem is that when the error is caught, the service won't stop and restart (I have set its properties to always restart upon stopping); it just hangs, which might not be so strange as there is really nothing that tells the service to stop (e.g., Me.Stop() or the like).
What do I need to insert before the End Try in order to actually stop/restart the service, if it's at all possible?
I don't want to do a lot of experimenting as I need to do this live and I hope that one of you knows if there is something I can do to accomplish this task. Surprisingly I haven't found anything on the Internet on this subject, but only what to do when an error ISN'T caught.
Warm regards from a snowy Sweden,
Pettrer