-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?

GEOCHET
  • 21,119
  • 15
  • 74
  • 98
billsecond
  • 612
  • 3
  • 21
  • 50
  • What are you trying to do that's causing the problem? – Tad Donaghe Nov 22 '11 at 17:11
  • If you can edit this question for clarity, please flag it for moderator attention to be reviewed. – Tim Post Nov 23 '11 at 06: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 '11 at 16:50
  • A question is not just a wall of text automatically-generated by a runtime exception followed by "What am I doing wrong?" We can't answer that because there isn't much we can infer from your stack trace alone. At the very minimum you should also include code that pertains to your error. – BoltClock Nov 24 '11 at 17:28
  • 1
    If a wall of text gets a good, accepted answer, it's most probably a fluke. – BoltClock Nov 24 '11 at 17:31
  • 1
    +1 for being googlable way to find some answers – Tim Lovell-Smith Dec 06 '12 at 01:12

2 Answers2

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...

Ria
  • 10,237
  • 3
  • 33
  • 60
Neil Thompson
  • 6,356
  • 2
  • 30
  • 53
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

Simon
  • 1,211
  • 9
  • 5