天继续调试WCF Web API源代码,方向是跟踪其单元测试,结果一上手就出了一个错误:
HTTP could not register URL http://+:8000/testservice/. Your process does not have access rights to this namespace (see http://go.microsoft.com/fwlink/?LinkId=70353 for details).
经过一番好找,才知道是由于在Vista和Win7中的安全设置引起的,使用"netsh.exe"命令可以将http://+:8000/testservice添加到安全设置中,方法如下:
netsh http add urlacl url=http://+:8000/ user=DOMAIN\UserName
截图: