Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WCF - An item with the same key has already been added

I keep getting an error when trying to open WCF WebService via http://www.example.com/WS/myExchange.svc:

System.ArgumentException An item with the same key has already been added.

System.ArgumentException: An item with the same key has already been added. at System.Runtime.AsyncResult.End[TAsyncResult](IAsyncResult result) at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult result) at System.ServiceModel.Activation.ServiceHttpModule.EndProcessRequest(IAsyncResult ar) at System.Web.HttpApplication.AsyncEventExecutionStep.OnAsyncEventCompletion(IAsyncResult ar)

When I open the same WS on the localhost, everything works normally.

I don't even know where to start searching for the root of the problem.

Is the problem in IIS configuration, installed modules, project code?

How to find out which item with the same key has already been added? Even if is it in Web.Config? In code? In database? In included modules?

Problem appears only on "/WS/myExchange.svc", other parts of the website work normally.

Advanced settings: enter image description here

Site bindings: enter image description here

like image 292
Tadej Avatar asked Nov 15 '25 11:11

Tadej


1 Answers

A possible cause is

  1. Your IIS web application's advanced settings indicates "http,https" in "Enabled Protocols".
  2. The "Default Web Site"'s "Site Bindings" does not have an https binding type.

See https://stackoverflow.com/a/19440427/6996876


Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!