The service '/Sample/SampleService.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.

by Michel 17. September 2009 13:55

Getting the error below in your eventlog and do you have multiple identities for your website (i.e: sample.domain.tld & localhost)?

Event Type:        Error
Event Source:     System.ServiceModel 3.0.0.0
Event Category: WebHost
Event ID:           3
Date:                 16-9-2009
Time:                 8:46:15
User:                  NT AUTHORITY\NETWORK SERVICE
Computer:          COMPUTERNAME
Description:
WebHost failed to process a request.
Sender Information: System.ServiceModel.ServiceHostingEnvironment+HostingManager/40535505
Exception: System.ServiceModel.ServiceActivationException: The service '/Sample/SampleService.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.

You could solve this issue by adding the following config section to your web.config:

    <system.serviceModel>
        ...
        <serviceHostingEnvironment>
            <baseAddressPrefixFilters>
                <add prefix="http://sample.domain.tld/Sample/"/>
            </baseAddressPrefixFilters>
        </serviceHostingEnvironment>
        ...
    </system.serviceModel>

Tags:

C# | Debug | .Net | WCF

About the author

Michel TolMy name is Michel Tol. I'm a developer specialized in .NET technologies. Mainly focussing on SharePoint Technologies and web development. I am Certified Technology Specialist for MOSS 2007 -  Configuration, .Net Framework 2.0 - Web applications and Biztalk Server 2006 - Custom Applications.

View Michel Tol's profile on LinkedIn

  

E-mail me Send mail

Page List