none
WCF Error RRS feed

  • Question

  • Hi all I am trying to deploy a wcf service and I am getting the following error: This collection already contains an address with scheme http.  There can be at most one address per scheme in this collection. I found a hack that changes the svc file by adding a attribute Factory. The only thing is when I try this I get a compolation error that says that the Factory attribute is not a vallid attribute for the ServiceHost tag. Does anybody know how to get this working.

    Monday, August 11, 2008 2:45 PM

Answers

All replies

  • The ServiceHost can have only one base address per scheme (HTTP, TCP, net.pipe, etc). It can have multiple endpoints per scheme that are relative to that base address. Make sure you're not specifying more than one in code or configuration (or both).
     
    Monday, August 11, 2008 3:59 PM
  • Where in the configuration do you check for it?

    Tuesday, August 12, 2008 12:31 PM
  • If you have base addresses defined in the config file, they will be under a section called "host" as follows:
    Code Snippet
     
            <host>
              <baseAddresses>
                <add baseAddress="http://localhost:8000/service"/>
                <add baseAddress="net.tcp://localhost:8001/service"/>
              </baseAddresses>
            </host>
     

     

     

     
    Tuesday, August 12, 2008 1:09 PM
  • Is there anywary in iis that this can be configured?

    Tuesday, August 12, 2008 1:14 PM
  • Under IIS your base address is provided by the host. Take a look at these links. The first one shows you how to host a WCF service in IIS and the latter two deal with corner cases that may help you out.
     
     
     
    Tuesday, August 12, 2008 1:32 PM
  • I checked out the links and it brings me back to my first problem

    <%@ ServiceHost Language="C#" Debug="true" Service="MyService.MyService" Factory="MyService.MultipleHostsFactory" %>
    The factory attribute above gives me a compolation error. How do I get past this?
    Tuesday, August 12, 2008 1:56 PM
  • I checked out the links tx.

    There's only one thing when looking at

    <%@ ServiceHost Language="C#" Debug="true" Service="MyService.MyService" Factory="MyService.MultipleHostsFactory" %>
    The factory attribute above gives me a compolation error. How do I get past this?
    Tuesday, August 12, 2008 1:59 PM
  • Unless your scenario is the same as the guy's who wrote the article, stick with the simple MSDN example (first link). Start over from sctatch, verify that you can get a simple Hello World app running, and then modify it with your custom interfaces and logic.
     
    Tuesday, August 12, 2008 2:04 PM
  • Thanks I thought this was going to be difficult. I know the code works. It was up and running this morning. The reason I asked about IIS is there were some configuration changes made and the next thing I knew I kept getting this error. Thanks for the help

    Tuesday, August 12, 2008 2:17 PM
  • I finnaly figured out what the problem was in IIS I had multiple header values specified.

    Wednesday, August 13, 2008 5:43 AM