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


Have you come across this issue HTTP could not register URL http://+ . Another application has already registered this URL with HTTP.SYS


 


Are you self hosting a WCF library service inside a console or windows forms application? Then the most likely cause of this problem is that you have the library project contained within your same solution.


The problem happens because the WCF Service Host running at the same time as your custom host application. You run or debug your app and when your host initialises the WCF stack, you will see an AddressAlreadyInUseException as in the above pic.  This is happening because the WCF Service Host in Visual studio is already listening on the same address...


Basically remove the wcf lib from the solution and reference it. When you run the host you should now be able to open it.


ServiceHost host = new ServiceHost(typeof(ClientHost));


Host.Open();


 


Now there should be no errorJ!


Rick Rainey's  suggested a fix to the config file which doesn’t work for me, but may for somebody else which prevents removing it from the project. http://blogs.msdn.com/rickrain/archive/2008/02/14/Preventing-the-WCF-Service-Host-from-launching-in-Visual-Studio-2008.aspx


I have not seen if this bug exists in 2010 yet.. I will update when I check it..


 


 


 


 

Comments (16)

  1. LKW says:

    Try disable the WCF Service Host for the library project.

    i.e.

    Right Click on the service library project and select Properties.

    Go to the WCF Options and uncheck the option Start WCF Service Host when debugging another project in the same solution

  2. StevieHutch says:

    LKW. Thank you. Unchecking the option "Start WCF Service Host when debugging another project in the same solution", fixed the problem for me.

  3. whyleee says:

    Thanks! I also unchecked the option "Start WCF Service Host when debugging another project…" and now it's all right.

  4. Martin Fallenstedt says:

    Thank you for this information. It fixes the problem on VS2010.

  5. Naji says:

    LKW, thanks for the short solution.

    Keithmg, thanks for suggesting better way to orgnize WCF project

  6. 劉喜超 says:

    thanks

  7. spundir says:

    thanks, for the solution…..

  8. swapnil says:

    Thanks! Unchecking the option "Start WCF Service Host when debugging another project…" worked for me.

  9. Rachit says:

    Worked for me as well .. Thanks

  10. Yeti says:

    Briliant! Appreciate that! Also worked! 🙂

  11. inciph says:

    Thanks LKW! Perfect simple fix that works.

  12. Mohamed Ahmed says:

    LKW. Thank you. Unchecking the option "Start WCF Service Host when debugging another project in the same solution", fixed the problem for me.

  13. Jerome Du says:

    Perfect! Thanks for help saving my time.

  14. LKW ROX says:

    Thanks LKW! You are a savior!!! Worked like a CHARM!!

  15. Avil says:

    Thanks to LKW for the solution. Worked.

  16. Fred says:

    Take this page down. It's 6 years old!!!

Skip to main content