加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Windows > 正文

wcf – 无法启动服务.无法注册网址

发布时间:2020-12-13 20:09:18 所属栏目:Windows 来源:网络整理
导读:我想在窗口服务中托管wcf.以前我做过几次,没有任何问题.这一次安装完服务并点击开始之后,我在EventViewer中收到以下错误. 服务无法启动. System.ServiceModel.AddressAccessDeniedException:HTTP无法注册URL http://:… / … /.您的进程对该命名空间没有
我想在窗口服务中托管wcf.以前我做过几次,没有任何问题.这一次安装完服务并点击开始之后,我在EventViewer中收到以下错误.

服务无法启动. System.ServiceModel.AddressAccessDeniedException:HTTP无法注册URL http://:… / … /.您的进程对该命名空间没有访问权限(有关详细信息,请参阅http://go.microsoft.com/fwlink/?LinkId=70353).

当我托管相同的服务时,ConsoleApplication上的地址相同 – 好的.

我看到了here和here的问题,但没有一个解决方案帮助我.

有没有人有想法?

对于你的答案,这是一个霰弹枪调试.您现在拥有一个具有管理员权限的网络服务:

LocalSystem Account (Windows):

The LocalSystem account […] has extensive privileges on the local computer,and acts as the computer on the network. Its token includes the NT AUTHORITYSYSTEM and BUILTINAdministrators SIDs; these accounts have access to most system objects.

Most services do not need such a high privilege level. If your service does not need these privileges,and it is not an interactive service,consider using the LocalService account or the NetworkService account. For more information,see Service Security and Access Rights.

所以你最好运行这个服务作为NetworkService,并给它适当的权限来使用您尝试使用的端口,如Configuring HTTP and HTTPS所述:

netsh http add urlacl url=http://+:80/MyUri user="NT AUTHORITYNETWORK SERVICE"

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读