0
votes

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.

2

2 Answers

7
votes

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
0
votes

I was working on a test WFC service hosted in Windows Service (Managed). Then I added another base address for HTTP. When I started the service again, I got the same error. I then changed the service account from "Local Service" to "Local System" and that resolved the issue. Since this was a test program, it was OK for me to continue.