开发者

Intermittent WCF error: Collection already contains an address with scheme http

I get this intermittent WCF 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

I tried various solutions by from googling around and from stackoverflow and they work for a while until t开发者_StackOverflow中文版he error shows up again and then I attempt another solution. It is really frustrating. Right now this is all voodoo to me as I don't understand why this is happening. It appears that if I touch the webconfig file and save it, the error disappears. I don't know if this causes it, but my webconfig is nested in that it lives under a special webservices folder. Any suggestions?


Take a look at how your IIS bindings are defined/configured in the IIS .config file located at...

C:\Windows\System32\inetsrv\config\applicationHost.config

Find your way to the Sites-Site-Bindings section, then look for bindings that have the same protocol defined. Example:

<binding protocol="http" bindingInformation="*:80:" />
<binding protocol="net.tcp" bindingInformation="8081:*" />
<binding protocol="net.pipe" bindingInformation="*" />
<binding protocol="net.msmq" bindingInformation="localhost" />
<binding protocol="msmq.formatname" bindingInformation="localhost" />
<binding protocol="https" bindingInformation="*:443:" />
<binding protocol="net.tcp" bindingInformation="9000:*" />

Notice there are two bindings for the "net.tcp" protocol. The above example configuration will throw the following error:

This collection already contains an address with scheme net.tcp. There can be at most one address per scheme in this collection. Paramter name: item

I personally experienced this error when I added the net.tcp protocol using the command prompt (as opposed to IIS Manager):

%windir%\system32\inetsrv\appcmd.exe set site "Default Web Site" -+bindings.[protocol-'net.tcp',bindinginformation-'9000:*']


If you have more than one http base endpoints (i.e. WsHttpBinding and BasicHttpBinding) and trying to add them at the same time, you will get this error.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜