C# – WCF Service Access right: No access rights to this namespace

chttpwcf

I'm getting the the following error while running my program with the task scheduler:

HTTP could not register URL http://+:4711/myWCFService/. 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

Run as administrator is unfortunately no solution for my problem. I also tried to register the http address with netsh but I'm getting still the same error.

Best Answer

What netsh command did you run?

netsh http add urlacl http://+:4711/ user=DOMAIN\USER

On your machine, the built-in administrator account has implicit ownership of all HTTP namespace reservations, so you need to delegate ownership of the specific namespace reservation (like above) to the target account that will be running the HTTP endpoint. You do this by ensuring you Run as administrator before performing the netsh command.

To check what namespace reservations are in place, run:

netsh http show urlacl
Related Topic