How do you set up HTTP ACL's for a WCF 3.0 RES

2019-08-01 03:38发布

I have been reading O'Reilly's "RESTful .NET" and am working with the example program on pg. 24 - 25. This sets up a custom binding for handling REST requests. When I execute the code, it fails as it does not have permission to set up listening on http://localhost:8889/TestHttp

According to MSDN (http://msdn.microsoft.com/en-us/library/ms733768%28VS.100%29.aspx), I need to configue netsh. I am using the following netsh string:

netsh http add urlacl url=http://localhost:8889/TestHttp user=DOMAIN\user

where DOMAIN\user is customized to my account.

This appears to process in an additional console window, but executing my code causes the same failure. Does anyone know how to fix this ?

Thanks,

Scott

标签: c# wcf rest netsh
1条回答
ら.Afraid
2楼-- · 2019-08-01 04:02

If you are on vista or windows 7 you need to run a cmd.exe session or powershell as administrator then run the command.

查看更多
登录 后发表回答