HTTP could not register URL

hmiguel picture hmiguel · Oct 20, 2014 · Viewed 21.7k times · Source

I'm trying start a service that uses port 8081. The service stop immediately after start. I look into event viewer and i see this:

Service cannot be started. System.ServiceModel.AddressAlreadyInUseException: HTTP could not register URL https:// +:8081/api/. Another application has already registered this URL with HTTP.SYS. ---> System.Net.HttpListenerException: Failed to listen on prefix 'https:// +:8081/api/' because it conflicts with an existing registration on the machine.

I tried to register url with netsh but it says that file already exists, but i can't delete the reservation and it not appear in reservation list (netsh http show urlacl).

netsh http add urlacl url=http:// +:8081/api/ user=\Everyone

Url reservation add failed, Error: 183 Cannot create a file when that file already exists.

netsh http delete urlacl url=https:// +:8081/api/

URL reservation delete failed, Error: 2 The system cannot find the file specified.

There's anything that i can do to solve this?

Note: The service runs well on another machines.

Answer

Mark picture Mark · Dec 23, 2014

Your delete command is using a https address as opposed to the http in the add command. Remove the 's' and it should work.