为什么我的托管 WCF 服务的 Windows 服务不能在 LocalService 或 NetworkService 帐户下运行 [英] Why won't my Windows Service that is hosting a WCF Service run under LocalService or NetworkService accounts

查看:24
本文介绍了为什么我的托管 WCF 服务的 Windows 服务不能在 LocalService 或 NetworkService 帐户下运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个简单的 Windows 服务托管 WCF 服务.我想在 LocalService 帐户(甚至是 NetworkService 帐户)下运行 Windows 服务.但是,当我尝试在这些帐户中的任何一个下启动它时,它会启动然后立即停止.它在 LocalSystem 帐户下启动并运行正常.关于如何解决为什么它不会在 LocalService 或 NetworkService 下保持运行的任何想法.

I have a simple Windows Service hosting a WCF Service. I want to run the Windows Service under the LocalService account (or even the NetworkService account). However when I try to start it under either of these accounts it starts then immediately stops. It starts and runs OK under the LocalSystem account. Any thoughts as to how to work out why it will not stay running under LocalService or NetworkService.

谢谢,

大卫

推荐答案

感谢从 marc_s 和 ho1 检查事件日志的建议,我发现我需要添加命名空间预留,如下所示:

Thanks to the suggestions to check the event log from marc_s and ho1 I found out that I needed to add a namespace reservation as follows:

netsh http add urlacl url=http://+:1239/BOBPersistenceServer/ user="Local Service"

请参阅 http://msdn.microsoft.com/en-us/library/ms733768.aspxhttp://msdn.microsoft.com/en-au/magazine/cc163531.aspx 了解更多详情.

See http://msdn.microsoft.com/en-us/library/ms733768.aspx and http://msdn.microsoft.com/en-au/magazine/cc163531.aspx for more details.

这篇关于为什么我的托管 WCF 服务的 Windows 服务不能在 LocalService 或 NetworkService 帐户下运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆