Sunday, 30 September 2012

HTTP COULD NOT REGISTER URL HTTP://+8080/MyServce

HTTP could not register URL http://+:8080/MyService/. Another application has already registered this URL

Problem :
While running a WCF solution (including a service project and a service host) the following error can occur:
“HTTP could not register URL http://+:8080/MyService/. Another application has already registered this URL with HTTP.SYS.”
I faced this problem when I tried to run some of the exercises while doing my labs in school.
Impact :
Application could not run in normal mode. And application gives an exception that ‘HTTP could not register URL http://+:8080/MyService/’.
Solution:
The exception itself has offered helping hands on how to register Http Namespace by saying(see http://go.microsoft.com/fwlink/?LinkId=70353 for details).
I ran the following command under the .Net Command Prompt.
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC>netsh http add urlacl url=http://+:8080/CalculatorService/Meta/ user=\Everyone
Url reservation add failed, Error: 5
The requested operation requires elevation (Run as administrator).

I didn’t get through it yet, because by default the .Net command prompt doesn’t have access to register the Http Namespaces.
I reran the .Net command prompt in Administrator mode (Right Click the .Net Command Prompt in Start Menu, and select Run as Administrator).
The same command worked well in Administrator mode.
C:\Windows\system32>netsh http add urlacl url=http://+:8080/MyService/ user=\Everyone
URL reservation successfully added

Another simple alternate to using netsh http command is to run the Visual Studio itself in Administrator mode.
Note: netsh is useful for a verity of work. Refer the following pages for more detail.
Netsh Command Reference for HTTP
Netsh Command Reference
 

No comments:

Post a Comment