I'm attempting to install the Windows Service I have written in F#, but I keep getting the following message when I run installutil
:
No public installers with the RunInstallerAttribute.Yes attribute could be found in the C:\path\to\service\myservice.exe assembly.
The Windows service installer code is below. Note that both of the things which the error message claims are missing are, in fact, present:
ProjectInstaller
is public.ProjectInstaller
is tagged/decorated withRunInstaller(true)
attribute.
The service installer code:
module Project.WindowsService.Installer
open System.Configuration.Install
open System.ComponentModel
open System.ServiceProcess
[<RunInstaller(true)>]
type public ProjectInstaller () as installer =
inherit Installer()
// Define the process settings
let processInstaller =
new ServiceProcessInstaller(
Account = ServiceAccount.LocalSystem,
Password = null,
Username = null)
// Define the service settings
let serviceInstaller =
new ServiceInstaller(
ServiceName = "Project.WindowsService",
DisplayName = "My Service",
Description = "Blah. Blah, blah, blah. And, of course, blah.",
StartType = ServiceStartMode.Automatic)
do
// Define the installers
[| processInstaller :> Installer
serviceInstaller :> Installer |]
|> installer.Installers.AddRange