RE: Windows Service AutoStart Problem (C#)
- From: "VinSand" <VinSand@xxxxxxxxxxxxxxxx>
- Date: Tue, 12 Apr 2005 04:22:01 -0700
Jeffrey,
thanks for your exelent answer.
I used a custom log in the eventlog (not the applicaiton log) and the
default setting was: "cleared after 7 day". I cleared this eventlog and
changed this setting to "Overwrite events as needed".
In my service I changed the Autolog property to "true" (so that start/stop
events are logged into the application log).
Besides that I only started a timer in the start event, and when timer was
expired I initialized and used my custom eventlog.
This all solved my problem.
Thanks for pointing me into the direction of the eventlog itself.
Cheers...
Vincent.
""Jeffrey Tan[MSFT]"" wrote:
> Hi VinSand,
>
> Thanks for your post!!
>
> Based on my understanding, you implemented an autostart windows service
> application in .Net, which works well, but it sometimes can not auto start
> on certain machines.
>
> Based on my experience, the problem is probably due to that the Application
> event log is full and it does not allow overwriting old entries. Under such
> circumstances, the call to the EventLog.WriteEntry in our code cannot
> succeed and the service fails to start eventually.
>
> Therefore, I would like to suggest you try clearing the event log and
> changing its settings first. Please follow the steps below to do these:
> 1. Open the Control Panel->Administrative Tools window;
> 2. Double click the Event Viewer icon;
> 3. In the log files tree shown in the left pane of the Event Viewer window,
> we will see three or more log files;
> 4. Right click on the Application Log node, and choose the Clear all Events
> command from the popup menu;
> 5. A message box will pop up prompting us to save the old entries of the
> log, click No; the Application Log will be cleared;
> 6. Right click the Application Log node again, and choose the Properties
> command from the popup menu; the Application Properties dialog box will
> show up;
> 7. In the General tab of the dialog box, ensure the "Overwrite events as
> needed" radio button is selected; this radio button is located in the Log
> size group box shown in the lower part of the dialog box;
> 8. Click OK to apply the changes.
>
> Hope this helps.
>
> Best regards,
> Jeffrey Tan
> Microsoft Online Partner Support
> Get Secure! - www.microsoft.com/security
> This posting is provided "as is" with no warranties and confers no rights.
>
>
.
- Follow-Ups:
- RE: Windows Service AutoStart Problem (C#)
- From: "Jeffrey Tan[MSFT]"
- Re: Windows Service AutoStart Problem (C#)
- From: Claudio Grazioli
- RE: Windows Service AutoStart Problem (C#)
- References:
- Windows Service AutoStart Problem (C#)
- From: VinSand
- RE: Windows Service AutoStart Problem (C#)
- From: "Jeffrey Tan[MSFT]"
- Windows Service AutoStart Problem (C#)
- Prev by Date: Re: Windows Service AutoStart Problem (C#)
- Next by Date: Re: Windows Service AutoStart Problem (C#)
- Previous by thread: RE: Windows Service AutoStart Problem (C#)
- Next by thread: Re: Windows Service AutoStart Problem (C#)
- Index(es):