共享主机上的 WCF 服务(此集合已经包含一个带有 http 方案的地址.) [英] WCF Services on shared hosting (This collection already contains an address with scheme http.)

查看:38
本文介绍了共享主机上的 WCF 服务(此集合已经包含一个带有 http 方案的地址.)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试调用 WCF 服务时收到以下错误:

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

Goog 告诉我解决方案如下(使用 .net 3.5 时,我是):

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> 

但是,当我尝试将其添加到我的 web.config 部分时,它告诉我它无效.

However, when I try to add this to the section of my web.config it tells me it is invalid.

推荐答案

你应该在 3.5 中改用这个:

You should use this instead in 3.5:

    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true"/>

如果您迁移到 4.0,您可以使用 svc less 激活,如下所示:ServiceRoute + WebServiceHostFactory 终止 WSDL 生成?如何使用 ?wsdl

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

这篇关于共享主机上的 WCF 服务(此集合已经包含一个带有 http 方案的地址.)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆