【问题标题】:WCF Service with Windows Service带有 Windows 服务的 WCF 服务
【发布时间】:2011-05-29 23:41:06
【问题描述】:

我创建了 WCF 服务库,并在 WCF 测试客户端(默认)上对其进行了测试。 当我在 winodws 服务中托管 WCF 服务时,我得到了错误。我正在使用 Windows XP、.Net 3.5 和 Visual Studio 2008。并且还使用 HTTPCFG.exe 将 URL 设置为 urlacl 概念,当时我也遇到了与下面给出的相同的错误。

打开主机时出错:HTTP 无法注册 URL“http://+:8731/WCFServerDLL/Service1/”。您的进程没有对此命名空间的访问权限(有关详细信息,请参阅“http://go.microsoft.com/fwlink/?LinkId=70353”)。

Windows XP sp3。

在这里我运行“httpcfg.exe set urlacl /u http://localhost:8731/WCFServerDLL/Service1/ /a "D:..."”

我得到结果

HttpSetServiceConfiguration 以 0 完成。

在 xp 中也使用 httpcfg 设置 URL。但我得到了同样的错误。

【问题讨论】:

    标签: c# wcf


    【解决方案1】:

    您必须添加一个 WCF 命名空间异常。使用这个命令

    netsh.exe http 添加 urlacl url=http://+:8731/ user={computername}\{username}

    编辑:

    对不起,netsh 适用于 Vista 和 7,我刚刚注意到您使用的是 XP。我对 XP 不太熟悉,但我相信以下方法会起作用。确保更换 myhost。

    httpcfg.exe 设置 urlacl /u http://myhost:8731/ /a

    【讨论】:

      猜你喜欢
      • 2011-06-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-12-03
      • 1970-01-01
      • 1970-01-01
      • 2014-08-02
      • 2011-07-14
      相关资源
      最近更新 更多