0

I have a Internet Information Services installed on a Windows Server 2019.

In the IIS I have hosted a svc service, but when i browse the service i'm getting the error below:

Module IIS Web Core

Error Code 0x800700b7

Config Error Cannot add duplicate collection entry of type 'add' with unique key attribute 'name' set to 'WebServiceHandlerFactory-ISAPI-4.0_64bit'

But when i remove these 4 handler line from the web.config, the service works fine:

    <handlers>
        <add name="WebServiceHandlerFactory-ISAPI-4.0_64bit" path="*.asmx" verb="*" modules="IsapiModule" scriptProcessor="C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness64" responseBufferLimit="0" />
        <add name="svc-ISAPI-4.0_64bit" path="*.svc" verb="*" modules="IsapiModule" scriptProcessor="C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness64" responseBufferLimit="0" />
    </handlers>

I have also another environment with the same setup, but here the service works fine without removing the handler lines from the web.config.

Can anyone explain to me what the handler line does and why I need them, also why i need to remove them in one environment but not in another environment.

thanks

Bala
  • 21
  • 4
  • Learn to use `remove` or `clear` tags to avoid such errors, [how to solve Error cannot add duplicate collection entry of type add with unique key attribute 'value' in iis 7](https://stackoverflow.com/questions/7455424/how-to-solve-error-cannot-add-duplicate-collection-entry-of-type-add-with-unique). The cause is simply because IIS allows settings to come from different levels (server/site/app), so you can easily hit duplicate items. – Lex Li May 11 '21 at 13:26
  • Hi thanks Lex Li for the answer.. i will check the hight level setting and the applicationhost setting as suggested in the link.. If i still get the error I will reply here! – Bala May 12 '21 at 11:13
  • Has your problem been solved? – samwu May 13 '21 at 09:29
  • Hello Samwu, no my problem hasn’t ben solved. I’m stilling getting the duplicere error after I have studied the link from Lex Li. Can you explain what the handler Line does and why I need Them.. – Bala May 14 '21 at 15:08

1 Answers1

0

Since the error message mentions a duplicate record, check the web.config for identical definitions:

  1. Enable Failed Request Tracing
  2. Add a rule
  3. If the issue occurs, check web.config file. Are there identical Failed Request Tracing rules?

If there are no duplicates, check the rules in tracing module at all application, site, and server levels in IIS Manager. Make sure there are no conflicting rules.

If the issue still persists, add the line below into web.config. It will remove all existing rules to prevent duplication.

<remove path="*" />
samwu
  • 3,857
  • 3
  • 11
  • 25