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/MyServiceName/. Another application has already registered this URL with HTTP.SYS.”
I faced this problem when I tried to run some of the practice exercises for MCTS 70-503 Training Kit.
Cause: When you set the solution starting program to the service host, visual studio still runs the WCF SVC Hostt before your service host project and it put a listener on the port before your host application does. This only happen when you run the solution in the debug mode. In the Start Withouth Debuging (Ctrl +F5) mode this does not happen.
Solution: I thought that WCF SVC Host could be disabled from the Service project>Properties>Debug Tab>Command Line Argument. It is a natural place to look for this and in fact I thought you should be able to remove the predefine value in the box “/client:”WcfTestClient.exe” and stop WCF SVC Host to run. However, it does not work. For more information you can read the following post on MSDN forum:Disabling WcfSvcHost when self-hosting. So I found the only way around this problem, is renaming the App.config file for the Service project to something like “App.config.temp”. This certainly stop executing WCF Test Client.