正确配置IIS6和WCF

时间:2011-09-02 09:47:19

标签: c# wcf iis iis-6

我有带有iss 6的Windows Server 2003并安装了.NET 4.0框架。然后使用本文http://msdn.microsoft.com/en-gb/library/aa751792.aspx我配置了IIS(运行ServiceModelReg.exe / i / x并获得了正面结果) 现在我尝试运行WCF服务包括Service1.svc,Web.Config和bin / anyname.dll(由VS2010中的默认项目生成) 当我从浏览器运行它时,我发现了这个错误:

    Server Error in '/ppgswcfrequests' Application.

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

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.ArgumentException: 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

也许我的IIS上的虚拟目录配置错误了? enter image description here

1 个答案:

答案 0 :(得分:0)

该错误看起来您为该网站设置了多个HTTP绑定,我在4周前遇到了类似的问题。我的解决方案是摆脱我在IIS中为我的网站设置的任何错误绑定。