Reputation: 298
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.
Upvotes: 4
Views: 7980
Reputation: 969
2023-12-08 I had this same exact error with IIS10 after renewing my certificates for one of my websites.
It was the first time I had this problem over at least 20 certificate renew process I've done so far.
Here was the solution to my problem:
Deleted all the https bindings of my website and remade them exactly identical.
Upvotes: -1
Reputation: 298
Problem solved.
In Web.Config, section system.serviceModel I had to add:
<serviceHostingEnvironment multipleSiteBindingsEnabled="true"/>
Upvotes: 0
Reputation: 4211
Check:
- Web.Config elements it could be possible duplicate.
- Check also whether it is 32 or 64 bit application in IIS.
- Application pools framework.
Upvotes: 0
Reputation:
A possible cause is
See https://stackoverflow.com/a/19440427/6996876
Upvotes: 12