【发布时间】:2014-06-24 14:54:36
【问题描述】:
我的 PC 上有一个基于 WCF 服务的复杂解决方案,但由于安装 Windows 8.1 时出现问题,我不得不“刷新”我的 PC。现在我重新安装了 Visual Studio 2012,我的项目不再正常运行。
当我调试单元测试时,wcfservicehost 显示错误:
Please try changing the HTTP port to 8733 or running as Administrator.
System.ServiceModel.AddressAccessDeniedException: HTTP could not register URL http://+:8732/Design_Time_Addresses/MyWCFService/Name/. 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
显然,通常的解决方案是以管理员身份运行 Visual Studio(可能是因为它会覆盖某处的内容)但是我无法执行此操作,因为我需要引用网络驱动器上的 DLL,而网络驱动器不能以管理员身份运行时访问。
我假设某处有一个配置文件或注册表项,用于确定 Visual Studio 或 WCF 服务主机在运行时使用的端口,并且那里有我之前安装的 Windows 的剩余项。
要将端口更改为 8733,需要编辑每个服务,重新引用它们,然后重新构建解决方案并希望它能正常工作。
有没有办法设置或强制 WCF 服务主机使用的端口?
【问题讨论】:
标签: wcf