一個WCF服務,我已經做出了Windows服務在該主機上http://localhost:8080/SomeService
託管從Windows服務
Windows服務WCF服務被配置爲使用網絡服務帳戶運行。
當我嘗試啓動服務,我得到以下異常:
System.ServiceModel.AddressAccessDeniedException: HTTP could not register URL
http://+:8000/. Your process does not have access rights to this namespace
(see http://go.microsoft.com/fwlink/?LinkId=70353 for details). --->
System.Net.HttpListenerException: Access is denied
我想要做的是一些代碼添加到服務安裝程序(內部AfterInstall
例如)爲服務提供適當的權利。
這怎麼能在C#中完成?
編輯
我知道,這項服務將在XP,Vista和Win7的計算機上安裝,所以我需要的東西,在所有這些平臺的作品。