none
Error when open .SVC file by IE RRS feed

  • Question

  • Hello,

    •  I create w new Project "WCFServiceLibrary" called "MarraigesServiceLibrary" . Add create my contracts and everything is ok .
    • I create an ASP.net web Site .
    •   in the ASP.net Site I Add "Marriages.svc"  file . And I write the following lines in it :

                  <%@ ServiceHost Service="MarraigesServiceLibrary.MarraigeService"  Factory="System.ServiceModel.Activation.WebScriptServiceHostFactory" %>

    • In the web.config of ASP.Net Site

              <system.serviceModel>
                 <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
                   <bindings />
                   <client />
              </system.serviceModel>

    • When I View browse the file "Marriages.svc" . it is working fine .
    • When I publish the "ASP.Net Site" on a server "Shared Server" . And try open the file "Marriages.svc" by IE , I get the following exception :

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

    How Can I solve this exception .

     Thanks


    ASk

    Thursday, March 29, 2012 12:19 PM

Answers

  • Hello, as the error message says, try to set multipleSiteBindingsEnabled to true:

    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />


    Lante, shanaolanxing This posting is provided "AS IS" with no warranties, and confers no rights.
    If you have feedback about forum business, please contact msdnmg@microsoft.com. But please do not ask technical questions in the email.

    • Marked as answer by himo Friday, March 30, 2012 11:17 AM
    Friday, March 30, 2012 2:56 AM