.NET Framework Developer Center > .NET Development Forums > Windows Communication Foundation > IIS hosting on XP: "Collection already contains an address with scheme http"
Ask a questionAsk a question
 

AnswerIIS hosting on XP: "Collection already contains an address with scheme http"

  • Friday, April 28, 2006 7:49 AMmcobrien Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hi, I'm trying to run some of the samples from the 15th April documentation CTP, but they keep failing in IIS with the error "Collection already contains an address with scheme http". I saw another post on the forum but it seems to describe an issue with host headers, which I think doesn't apply to my problem since I'm running XP.

    The exact same code hosts OK with the development server (c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\WebDev.WebServer.EXE), so this has to be an IIS problem, right? Any ideas about how I could troubleshoot this?

    Oh, I was going to try to run servicemodelreg.exe as described in the help to try to fix this, but I can't find it in my fx directory... Is it actually located somewhere else or has its name changed?

    thanks!

Answers

  • Friday, April 28, 2006 4:59 PMSteve MaineMSFTUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    One thing to check --

    Open up the IIS Manager snap-in and right-click on the "Default Web Site" and select Properties. On the "Web Site" tab in the "Web Site Identification", click the "Advanced" button.

    That should bring up the "Advanced Multiple Web Site Configuration" dialog box. Take a look at the top list box -- if there's more than one entry in there, that's likely the source of this problem.

    Technically speaking, when you host services in IIS, the web server provides the base address for your service. These addresses are derived from the Site bindings, which are controlled via this dialog. We support exactly one base address per protocol.

All Replies

  • Friday, April 28, 2006 4:40 PMScott Mason - MSFT Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    I'm not sure which samples you're trying to run.  Can you give me a specific sample you're having problems with?

    The error is thrown because it's trying to add more than one baseaddress with the same scheme.  So in other words, since you're hosting in IIS it's going to have a baseaddress with an http (or https) scheme.  If you try to add another baseaddress with http (or https) to the ServiceHost baseaddress collection it will blow up with that error message.

    Thanks!

    Scott

  • Friday, April 28, 2006 4:59 PMSteve MaineMSFTUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    One thing to check --

    Open up the IIS Manager snap-in and right-click on the "Default Web Site" and select Properties. On the "Web Site" tab in the "Web Site Identification", click the "Advanced" button.

    That should bring up the "Advanced Multiple Web Site Configuration" dialog box. Take a look at the top list box -- if there's more than one entry in there, that's likely the source of this problem.

    Technically speaking, when you host services in IIS, the web server provides the base address for your service. These addresses are derived from the Site bindings, which are controlled via this dialog. We support exactly one base address per protocol.
  • Tuesday, May 02, 2006 2:42 PMmcobrien Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hi Steve, that solved it, thanks!
  • Monday, August 21, 2006 2:33 AMProdactor Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Is there any way to specify the correct host address, where there are multiples?
    Is there a work around?
    Our test and production servers both use multpile addresses, is this going to be addressed in a future release?
  • Thursday, February 08, 2007 8:18 PMMark A. Richman Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    I get this error on Windows Server 2003 as well. My sites are all provisioned with multiple host header site bindings. Any workaround at all?
  • Monday, February 12, 2007 11:02 AMOliviertje Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Is there a workaround for this. In our hosting envirement all servers always have multiple host header values. This means we can't host any wcf service in IIS?
  • Wednesday, February 28, 2007 3:19 AMMark A. Richman Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    This is quite important, since I'm a web hoster. Each of my customers' sites are provisioned with serveral ServerBindings in the metabase, not just www.domain.com. This is causing the problem, espcially for shared hosting.

    I'd like to offer my customers a simple workaround via web.config if possible. Not everyone has the skills or desire to modify their WCF service just to work around this "feature". They'll just go to another web host that doesn't allow multiple host headers. Not good for business.

    Can you offer a workaround, or point me to a KB article that I can give my customers who want to use WCF?

    Thanks,
    Mark
  • Tuesday, October 02, 2007 9:40 PMRobz Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
  • Wednesday, October 03, 2007 4:59 AMRobz Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
  • Friday, January 18, 2008 12:21 PMSimone Busoli Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    An issue report has been created on Microsoft Connect, you might consider voting for it: https://connect.microsoft.com/wcf/feedback/ViewFeedback.aspx?FeedbackID=322896
  • Friday, February 22, 2008 11:50 PMZackL Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

     

    This solved our problem as well.  Thanks for taking the time to post a solution.  I love the web Big Smile.  This problem would have taken eons to solve "back in the day".

     

    Just for further clarification, is the error simply due to multiple Host Headers being configured or is it because the 2 Host Headers are "pointed at" different IPs?

     

    Many Thanks,

     

    Zack

  • Monday, July 21, 2008 12:16 PMChrisWeg Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Solution in .Net Fx3.5: BaseAddressPrefixFilters

    http://blogs.msdn.com/rampo/archive/2008/02/11/how-can-wcf-support-multiple-iis-binding-specified-per-site.aspx