【问题标题】:Hosting a WCF service from a Windows Service从 Windows 服务托管 WCF 服务
【发布时间】:2013-12-21 00:31:18
【问题描述】:

我创建了一个 Windows 服务,在 http://localhost:8080/SomeService 上托管 WCF 服务

Windows 服务配置为使用 NetworkService 帐户运行。

当我尝试启动服务时,出现以下异常:

System.ServiceModel.AddressAccessDeniedException: HTTP could not register URL http://+:8000/. Your process does not have access rights to this namespace (see @987654321@ for details). ---> System.Net.HttpListenerException: Access is denied

我想要做的是向服务安装程序添加一些代码(例如在AfterInstall 中)以赋予服务适当的权限。

如何在 C# 中做到这一点?

编辑

我知道这项服务会安装在 XP、Vista 和 Win7 机器上,所以我需要在所有这些平台上都能运行的东西。

【问题讨论】:

    标签: c# wcf http windows-services


    【解决方案1】:

    试试LocalSystem 帐户。 (填充剩余空间)

    【讨论】:

      【解决方案2】:

      在您启动应用程序时尝试“以管理员身份运行”

      【讨论】:

        猜你喜欢
        • 2013-08-06
        • 2012-04-28
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多