Happy days! Carl Nolan is flying along with templates for F# programming - we now have a Simple Windows Service template up on Visual Studio gallery!
From Carls' blog:
This template provides several projects elements:
The MyService.fs source file provides the implementation of the service. The template code provides the structure for the OnStart and OnStop methods and shows how an EventLog can be created and referenced:
The entry point for the program is defined in the Program.fs source file:
As you can see for a service the entry point is defined using the [<EntryPoint>] attribute.
Finally, so that the installutil tool correctly installs the service, an Installer class is also defined:
The template version installs the service using the Local System account. However, this can easily be changed.
Finally, the template creates a command file that can be used to install and un-install the service. When running this command file you will need a command prompt running with elevated privileges.
Once again, hopefully you will find this template useful.