Amar
01-03-2003, 03:41 PM
i have a windows service in Vb.Net. In the Onstart() method i just have one
line of code " Beep()". I have the same line of code in OnStop().
My service consists only of these 2 methods. This service runs fine after
installing and starting.
The problem comes when my application event log is full and then i try to
start my service.The service does not start. This is because the SCM tries
to write to the application event log during the OnStart() method. It does
so because by default the Autolog property of the service is True.
Now if i set this autolog property to false, it will work fine. But i am
interested in knowing if i can trap this exception that does not occour in
the method itself but somewhere in the background. And also i would really
appreciate if you could suggest me what action to take on trapping this exception.
My code is as below:
Protected Overrides Sub OnStart(ByVal args() As String)
Beep()
End Sub
Protected Overrides Sub OnStop()
Beep()
End Sub
Thanks in advance.
line of code " Beep()". I have the same line of code in OnStop().
My service consists only of these 2 methods. This service runs fine after
installing and starting.
The problem comes when my application event log is full and then i try to
start my service.The service does not start. This is because the SCM tries
to write to the application event log during the OnStart() method. It does
so because by default the Autolog property of the service is True.
Now if i set this autolog property to false, it will work fine. But i am
interested in knowing if i can trap this exception that does not occour in
the method itself but somewhere in the background. And also i would really
appreciate if you could suggest me what action to take on trapping this exception.
My code is as below:
Protected Overrides Sub OnStart(ByVal args() As String)
Beep()
End Sub
Protected Overrides Sub OnStop()
Beep()
End Sub
Thanks in advance.