【发布时间】:2012-02-29 14:47:09
【问题描述】:
我正在尝试在 Web 服务器上托管我的 WCF 应用程序。我收到此错误,但它在我的本地系统中运行良好
错误
这个集合已经包含一个带有 http 方案的地址。那里 此集合中的每个方案最多可以是一个地址。如果你的 服务托管在 IIS 中,您可以通过设置解决问题 'system.serviceModel/serviceHostingEnvironment/multipleSiteBindingsEnabled' 为真或指定 'system.serviceModel/serviceHostingEnvironment/baseAddressPrefixFilters'。
参数名称:项目
说明:在执行当前 Web 请求期间发生未处理的异常。请查看堆栈跟踪以获取更多信息 有关错误的信息以及它在代码中的来源。
异常详细信息: System.ArgumentException:此集合已包含一个采用 http 方案的地址。最多可以有 此集合中的每个方案一个地址。如果您的服务正在 托管在 IIS 中,您可以通过设置解决问题 'system.serviceModel/serviceHostingEnvironment/multipleSiteBindingsEnabled' 为真或指定 'system.serviceModel/serviceHostingEnvironment/baseAddressPrefixFilters'。 参数名称:项目
来源错误:
在执行过程中产生了一个未处理的异常 当前的网络请求。有关原产地和位置的信息 可以使用下面的异常堆栈跟踪来识别异常。
堆栈跟踪:
[ArgumentException: 这个集合已经包含一个地址 计划http。在这个方案中,每个方案最多可以有一个地址 收藏。如果您的服务托管在 IIS 中,您可以修复 通过设置问题 'system.serviceModel/serviceHostingEnvironment/multipleSiteBindingsEnabled' 为真或指定 'system.serviceModel/serviceHostingEnvironment/baseAddressPrefixFilters'。 参数名称:项目]
System.ServiceModel.UriSchemeKeyedCollection.InsertItem(Int32 索引, Uri 项目)+12089046
System.Collections.Generic.SynchronizedCollection`1.Add(T item) +78
System.ServiceModel.UriSchemeKeyedCollection..ctor(Uri[] 地址) +72 System.ServiceModel.ServiceHost..ctor(Type serviceType, Uri[] baseAddresses) +141
System.ServiceModel.Activation.ServiceHostFactory.CreateServiceHost(类型 serviceType, Uri[] baseAddresses) +30
System.ServiceModel.Activation.ServiceHostFactory.CreateServiceHost(字符串 构造函数字符串,Uri[] baseAddresses) +420
System.ServiceModel.HostingManager.CreateService(字符串 标准化虚拟路径)+1440
System.ServiceModel.HostingManager.ActivateService(字符串 normalizedVirtualPath) +44
System.ServiceModel.HostingManager.EnsureServiceAvailable(字符串 normalizedVirtualPath) +615[ServiceActivationException: 服务 '/GUIService.svc' 不能 由于编译期间的异常而激活。例外 消息是:这个集合已经包含一个带有方案的地址 http。此集合中的每个方案最多可以有一个地址。 如果您的服务托管在 IIS 中,您可以通过以下方式解决问题 环境 'system.serviceModel/serviceHostingEnvironment/multipleSiteBindingsEnabled' 为真或指定 'system.serviceModel/serviceHostingEnvironment/baseAddressPrefixFilters'。 参数名称:项目。] System.Runtime.AsyncResult.End(IAsyncResult 结果)+679246
System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult 结果)+190
System.ServiceModel.Activation.ServiceHttpModule.EndProcessRequest(IAsyncResult ar) +300622
System.Web.AsyncEventExecutionStep.OnAsyncEventCompletion(IAsyncResult a) +8837348
谁能帮我解决这个问题。
【问题讨论】:
-
您可以为您的 WCF 服务发布 web.config 吗?机器上还有其他服务吗?还要提高你的接受率,满分 10 分?
-
感谢您的回复。是的,它在我的本地机器上工作。另一件事是你要求 Web 配置。我很高兴地说,Web 配置文件中有一些敏感数据。所以你需要哪一部分。我只会发送那部分。谢谢
-
@SantoshSahu:我们需要查看您的
<system.serviceModel>标记中的所有内容 - 这就是 WCF 配置
标签: c# asp.net wcf asp.net-4.0