Go to all the events of your service like Onstart,OnPause,OnStop and OnContinue and add a message line as shown below.
protected override void OnStart(string[] args) { oMoveFile = new MoveFile(); moveFileEventLog.WriteEntry("MoveFiles Service Started",EventLogEntryType.Information); } protected override void OnPause() { moveFileEventLog.WriteEntry("MoveFiles Service Paused",EventLogEntryType.Information); oMoveFile.PauseMoving(); } protected override void OnStop() { moveFileEventLog.WriteEntry("MoveFiles Service Stopped",EventLogEntryType.Information); oMoveFile.StopMoving(); }
protected override void OnContinue() { moveFileEventLog.WriteEntry("MoveFiles Service Resumed",EventLogEntryType.Information); oMoveFile.ResumeMoving(); }
Now go back to the design mode of your service to add installer for your log.
Select your event log... Check out its properties.... Below its properties there is an add installer link.
This will add an eventloginstaller in your project installer class.
Build uninstall the older version if installed and then reinstall your service.
Check out the application log in the even viewer will find the start message.
Try to pause and resume the service; its corresponding event log messages will be registered.
-- Please post your queries and comments for my articles in the user group for the benefit of all. I hope this step from my end is helpful to all of us. Regards,
To stop getting this e-mail, or change how often it arrives, go to your E-mail Settings.
Need help? If you've forgotten your password, please go to Passport Member Services.
For other questions or feedback, go to our Contact Us page.
If you do not want to receive future e-mail from this MSN group, or if you received this message by mistake, please click the "Remove" link below. On the pre-addressed e-mail message that opens, simply click "Send". Your e-mail address will be deleted from this group's mailing list.
Remove my e-mail address from dotNET User Group Hyd.