-1

I am getting this error:

Server Error in '/cms' Application.

This collection already contains an address with scheme http. There can be at most one address per scheme in this collection. If your service is being hosted in IIS you can fix the problem by setting 'system.serviceModel/serviceHostingEnvironment/multipleSiteBindingsEnabled' to true or specifying 'system.serviceModel/serviceHostingEnvironment/baseAddressPrefixFilters'. 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. If your service is being hosted in IIS you can fix the problem by setting 'system.serviceModel/serviceHostingEnvironment/multipleSiteBindingsEnabled' to true or specifying 'system.serviceModel/serviceHostingEnvironment/baseAddressPrefixFilters'. Parameter name: item

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

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

collection. If your service is being hosted in IIS you can fix the problem by setting 'system.serviceModel/serviceHostingEnvironment/multipleSiteBindingsEnabled' to true or specifying 'system.serviceModel/serviceHostingEnvironment/baseAddressPrefixFilters'. Parameter name: item] System.ServiceModel.UriSchemeKeyedCollection.InsertItem(Int32 index, Uri item) +16395359 System.Collections.Generic.SynchronizedCollection`1.Add(T item) +79 System.ServiceModel.UriSchemeKeyedCollection..ctor(Uri[] addresses) +222 System.ServiceModel.ServiceHost..ctor(Type serviceType, Uri[] baseAddresses) +346 System.ServiceModel.Activation.ServiceHostFactory.CreateServiceHost(Type serviceType, Uri[] baseAddresses) +43 System.ServiceModel.Activation.ServiceHostFactory.CreateServiceHost(String constructorString, Uri[] baseAddresses) +530 System.ServiceModel.HostingManager.CreateService(String normalizedVirtualPath) +1413 System.ServiceModel.HostingManager.ActivateService(String normalizedVirtualPath) +50 System.ServiceModel.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath) +1172

[ServiceActivationException: The service '/cms/service.svc' cannot be activated due to an exception during compilation.  The exception

message is: This collection already contains an address with scheme http. There can be at most one address per scheme in this collection. If your service is being hosted in IIS you can fix the problem by setting 'system.serviceModel/serviceHostingEnvironment/multipleSiteBindingsEnabled' to true or specifying 'system.serviceModel/serviceHostingEnvironment/baseAddressPrefixFilters'. Parameter name: item.] System.Runtime.AsyncResult.End(IAsyncResult result) +901424 System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult result) +178702 System.Web.AsyncEventExecutionStep.OnAsyncEventCompletion(IAsyncResult ar) +107

-------------------------------------------------------------------------------- Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.237

What am I doing wrong?

6
  • What are you trying to do that's causing the problem? Nov 22, 2011 at 17:11
  • If you can edit this question for clarity, please flag it for moderator attention to be reviewed.
    – Tim Post
    Nov 23, 2011 at 6:06
  • This question is a very simple question, I feel like i was ambushed here by everyone. Why would you close a simple question? I see questions like this all of the time, and they become very helpful. My suggestion is that if you feel this is incomplete, then maybe you don’t understand the topic. There were several others that did understand it, and they were able to provide an answer to help me before you all voted to close the question. Please do not vote to close my questions again.
    – billsecond
    Nov 24, 2011 at 16:50
  • 1
    If a wall of text gets a good, accepted answer, it's most probably a fluke.
    – BoltClock
    Nov 24, 2011 at 17:31
  • 1
    +1 for being googlable way to find some answers Dec 6, 2012 at 1:12

2 Answers 2

5

As Steven Cheng once said:

Based on my understanding, this error is expected when the WCF's IIS hosting site has multiple host header associated with it (while WCF host can accept only one base address for each transport scheme).

He suggested a good blog entry explaining this problem and the resolution:

..I'd link to the source but I've lost it...

3

Is there a service with multiple endpoints in your web.config file? If there are multiple endpoints for a single service (In section), then only one endpoint can have no address attribute set. The other endpoints need to have the address setting.

From the client side, if you want to use the endpoint with the new endpoint address, you need to include it in the address, such as "http://localhost/cms/Service.svc/newEP"

http://msdn.microsoft.com/en-us/library/ms731320.aspx

http://msdn.microsoft.com/en-us/library/aa751841.aspx

Not the answer you're looking for? Browse other questions tagged or ask your own question.