I had the same problem. In the end, I added the following code, which works well and has the added benefit of not requiring installutil.exe. The service can install / uninstall on its own by going to the correct command line option. Save all your code and add the following:
module Program = let getInstaller() = let installer = new AssemblyInstaller(typedefof<atf>.Assembly, null); installer.UseNewContext <- true installer let installService() = let installer = getInstaller() let dic = new System.Collections.Hashtable() installer.Install(dic) installer.Commit(dic) let uninstallService() = let installer = getInstaller() let dic = new System.Collections.Hashtable() installer.Uninstall(dic) [<EntryPoint>] let main (args:string[]) = match (args |> Seq.length) with |1 -> match (args.[0]) with |"-install" -> installService() |"-uninstall" -> uninstallService() |_-> failwith "Unrecognized param %s" args.[0] |_ -> ServiceBase.Run [| new atf() :> ServiceBase |] 0
For installation, you can do the following from the command line:
atfwindowsservice.exe -install
source share