Jon Flanders' Blog

Multi-named web sites and WCF

Friday, June 06, 2008 1:51:29 PM (GMT Standard Time, UTC+00:00)

Glav posts about a problem I've also had recently - that Matt helped me figure out how to solve.

The exception is (repeated here for seach purposes):

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

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.ArgumentException: This collection already contains an address with scheme http.  There can be at most one address per scheme in this collection.
Parameter name: item

The way to solve this problem is to setup multiple web sites in IIS (rather than having one site that has multiple Host entries) - and point all the websites to the same directory.

Hope this helps someone.

  #    Comments [2]   

Friday, June 06, 2008 3:40:32 PM (GMT Standard Time, UTC+00:00)
I ran into this very problem, and had read Rob Zelt's blog about the custom host factory solution. While possibly being more administrative overhead, yours is a very elegant and simple solution. It also made me think "Duh, why didn't I think of that?!" Thanks for sharing!
Sunday, July 13, 2008 11:13:59 PM (GMT Standard Time, UTC+00:00)
I was dealing with this exact problem. Very simple, thanx!
All comments require the approval of the site owner before being displayed.
Name
E-mail
Home page

Comment (HTML not allowed)  

Enter the code shown (prevents robots):

Navigation

Books

Courses

Search

Subscribe

  • RSS 2.0
  • Add to Windows Live button
  • Add to Google button
  • Add to MyMSN button
  • Add to MyYahoo button
  • Add to Bloglines button
  • Add to Newsgator button