WCF service startup error “This collection already contains an address with scheme http”

Hello World,

Today, I was trying to setup a simple WCF service on my hosting service smarterasp.net (they are superb! I’ve been using them for about two weeks and it has been a breeze to setup websites and applications using their control panel. I came across them through a thread about hosting options for ASP.NET on Quora)

So, while setting up the service with basic HTTP binding, everything ran fine on my dev machine (it always does right?!) but when I deployed to the hosting site using VS Deploy, I ran into a YSOD (yellow screen of death for the uninitiated) that complained

“This collection already contains an address with scheme http”.

To be fair, the error screen described the fix as well, but to be a 100% sure, I looked up the error and found this stackoverflow thread:

Source: WCF service startup error “This collection already contains an address with scheme http”

I followed the configuration based solution described in the accepted answer and was able to get the service running absolutely fine.

In summary, I added this in the Web.config:

<system.serviceModel>
    <serviceHostingEnvironment>
        <baseAddressPrefixFilters>
            <add prefix="http://mydomain"/>
        </baseAddressPrefixFilters>
    </serviceHostingEnvironment>
</system.serviceModel>
Hope this helps.

Happy Coding! 
Advertisements
Posted in Uncategorized

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

  • Comic for August 17, 2017
    Dilbert readers - Please visit Dilbert.com to read this feature. Due to changes with our feeds, we are now making this RSS feed a link to Dilbert.com.
%d bloggers like this: