我的問題是: 當我嘗試安裝我的Windows服務我得到以下錯誤:錯誤安裝一個Windows服務(在F#)
片段: ... No public installers with the RunInstallerAttribute.Yes attribute could be found in the <path to exe> assembly. ...
我遵循這個tutorial
我有一個包含一個Program.fs
文件:
[<RunInstaller(true)>]
type public FSharpServiceInstaller() =
inherit Installer()
do
< some logic, doesn't really matter >
釷應該是足夠的,事實上,我甚至不認爲我需要將public
關鍵字添加到類型定義中。與InstallUtil.exe
安裝此可執行文件給了我同樣的錯誤使用下面的代碼安裝它:
[<EntryPoint>]
let main args =
if Environment.UserInteractive then
let parameter = String.Concat(args);
match parameter with
| "-i" -> ManagedInstallerClass.InstallHelper [| Assembly.GetExecutingAssembly().Location |]
| "-u" -> ManagedInstallerClass.InstallHelper [| "/u"; Assembly.GetExecutingAssembly().Location |]
| _ -> printf "Not allowed!\n"
else
ServiceBase.Run [| new CreditToolsService() :> ServiceBase |];
0
我試圖運行在PowerShell中,CMD和Visual Studio CLI這個腳本管理員和我正常的帳戶,但我不斷收到同樣的錯誤。如果有人知道我在做什麼錯,我會非常感謝一些幫助。
相關:http://stackoverflow.com/q/31081879/126014 –
感謝您發表評論我真的很感激。我已經檢查了相關的問題,儘管操作員詢問「相同」的問題,但沒有答案。只是一個實現示例。 – Baudin999