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

2019-08-01 03:49发布

问题:

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

回答1:

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



标签: c# wcf rest netsh