Is there any things to take care of when running your process or executable as service.Things like silent logging.Critical error reporting scenarios? etc? How do you handle it ?
Is there any things to take care of when running your process or executable as service.Things like silent logging.Critical error reporting scenarios? etc? How do you handle it ?
For critical error reporting, you are constrained to using the standard Service settings (in the properties of the installed service), or doing something yourself. This could be as simple a log file that logs unexpected errors (by using AppDomain.UnhandledException to catch and log them), using the Windows event log to log similar info, or having another process watch the service for errors (ie. the service stopping) and alerting someone.
Microsoft has an article entitled "Introduction to Windows Service Applications" that is a good general introduction to making services in .Net.
Some other things about developing Windows services from my experience:
OnStart method of the service kicks off a new thread to run the service and then returns.Don't show any message boxes / dialogs.
Be aware that your app will usually not run under the same account as a logged-in user. So if a user is able to access some file/directory, this does not mean that the service can do as well.
Make sure you have some form of alert system to inform you if the service falls over e.g. send an email to yourself or some mailbox.
If it makes sense, don't forget to implement the Pause event. Handle all exceptions so it fails gracefully when it fails.