Building a WCF Service? Make sure you think about how it’s hosted…

Got a bit of a wake up call this morning when I went to deploy a new WCF Service to our internal web server.  We’re going to use it for an external Resume Database to talk to, but initially it will be internal only.  Well, what I found out, rather rudely, is that if you assign multiple host headers to an IIS site for WCF, you’ll get this rather unfriendly little error:

This collection already contains an address with scheme http.  There can be at most one address per scheme in this collection.

Essentially, it’s finding more than one item to bind to, so it freaks out because WCF doesn’t support multiple IIS bindings for the same protocol.  There is a work around, which is to create a ServiceHostFactory, about which more information can be found here:http://msdn.microsoft.com/en-us/library/aa702697.aspx

Maybe that’ll help me remember to do this when I switch this to an external WCF service…

Add comment

  Country flag

biuquote
  • Comment
  • Preview
Loading

About the author

riceboyler is the pseudonym of one Jason Clark, an IT guy who does ASP.NET and Windows Phone development from time to time, waxes poetic about VMWare, Netapp and Dell, and quite frequently posts things that have nothing to do with computers, but deal with life as a father, husband, Webelos Leader and Latter-day Saint.

Follow him on Twitter at @riceboyler.

Month List