Blog Post

IIS Support Blog
2 MIN READ

Duplicate collection entry of type (0x800700b7)

Nedim's avatar
Nedim
Former Employee
Nov 05, 2020

Here is the error message displayed for one of the applications after I enabled Failed Request Tracing in the IIS server:

 

Cannot add duplicate collection entry of type ‘add’ with unique key attribute ‘path’ set to ‘*’

 

 

Solution

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="*" />

 

The entire configuration of the Failed Request Tracing rule in the web.config:

 

<configuration>
    <system.webServer>
        <tracing>
            <traceFailedRequests>
                <remove path="*" />
                <add path="*">
                    <traceAreas>
                        <add provider="ASP" verbosity="Verbose" />
                        <add provider="ASPNET" areas="Infrastructure,Module,Page,AppServices" verbosity="Verbose" />
                        <add provider="ISAPI Extension" verbosity="Verbose" />
                        <add provider="WWW Server" areas="Authentication,Security,Filter,StaticFile,CGI,Compression,Cache,RequestNotifications,Module,FastCGI,WebSocket" verbosity="Verbose" />
                    </traceAreas>
                    <failureDefinitions statusCodes="500" />
                </add>
            </traceFailedRequests>
        </tracing>
    </system.webServer>
</configuration>

 

Note: In my case, the environment this issue occurred had two IIS servers pointing to the same web.config (located in a network share).

Published Nov 05, 2020
Version 1.0

2 Comments

  • FeMick's avatar
    FeMick
    Copper Contributor

    I am considering deleting both entries perhaps one at a time, then adding them in one at a time. Would have to decide which to do first, whether to delete the start and end tags, etc. 

    Ideas?

  • FeMick's avatar
    FeMick
    Copper Contributor

    I have this same error but in a different context. The duplication is not in web.config but in 

    windows/system32/inetserv/config/applicationHOST.config

    You must logged in as an Administrator to see this file

    I have seen several or many solutions when it is in web.config, too many for me to start messing with, so looking for suggestions 🙂

    Here is a pic of the duplication...

    [BTW, I see no SAVE button anywhere on my screen, and when I clicked Preview my post disappeared, came back on Exit Preview]

     

    Thank you,

    Mick