问题
When trying to call a WCF service I receive the following error:
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 Goog tells me that the solution is as follows (when using .net 3.5, which I am):
<baseAddressPrefixFilters>
<add prefix="http://mydomain.com.au"/>
</baseAddressPrefixFilters>
However, when I try to add this to the section of my web.config it tells me it is invalid.
回答1:
You should use this instead in 3.5:
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true"/>
if you move to 4.0 you can use svc less activation as shown here: ServiceRoute + WebServiceHostFactory kills WSDL generation? How to create extensionless WCF service with ?wsdl
来源:https://stackoverflow.com/questions/7801674/wcf-services-on-shared-hosting-this-collection-already-contains-an-address-with