Problem with windows service in vb.net 
Author Message
 Problem with windows service in vb.net

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.



Wed, 22 Jun 2005 06:51:11 GMT  
 Problem with windows service in vb.net


Quote:
> 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.

I'm not sure, but if the event log is full, Windows will throw up a message
box to that effect.  If there is no user logged on, then the message box
cannot be cleared.

If you right click on the event log and select properties, you can set
options that determines what happens when the log is full. I just uusally
set it to overwrite older events as needed.

HTH

Chris

--
If you don't like lunchmeat, please remove it from my e-mail address to
send me an e-mail



Sun, 26 Jun 2005 05:39:55 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Windows Service in VB.NET - Failed to process service command

2. Window Service upgrade to VB.Net 2003

3. Windows Service in VB.NET

4. look if a nt service is runnning (window 2000 server), in vb net

5. Windows Services in VB.net

6. Installing VB.NET Windows Service on different machine.

7. deploying windows service application (vb.net)

8. Self-Installing VB.NET Windows Service

9. windows service. vb.net

10. Impersonate a user inside a windows service (vb.net)

11. vb.net windows service

12. windows service using VB.NET

 

 
Powered by phpBB® Forum Software