Search This Blog

Tuesday, February 26, 2013

WCF Error: "This collection already contains an address with scheme http"

This comes when pushing a new WCF service up from development to production -- it'll work fine in dev, then fail with this message in production:

"This collection already contains an address with scheme http"

The solution is to update the web.config section of the IIS hosted WCF service and the app.config section of the library used by WCF and is described in a couple different links:





In my case, I put this code right after the <servicemodel> tag:

<servicemodel>
  <serviceHostingEnvironment>
    <baseAddressPrefixFilters>
        <add prefix=http://mignysm95bakpv.nysemail.nyenet"/>
    <baseAddressPrefixFilters>
  </serviceHostingEnvironment>
....
etc. etc. etc. ....
</servicemodel>





I wish I knew WCF well enough to say what the fix is actually doing but at present I can't quite say what's going on -- I'm still learning it and, once I find out what my problem is, I'll add to this post.  In the meantime, I've just got to get this running.

No comments: