Article ID: 949349 - Last Review: February 22, 2008 - Revision: 1.0

Error message when you use Server Manager in IIS 7.0 to open a feature configuration page: "Cannot add duplicate collection entry"

On This Page

Expand all | Collapse all

SYMPTOMS

When you use Server Manager in Internet Information Services (IIS) 7.0 to open a feature configuration page, you receive the following error message:
There was an error while performing this operation.

Details:

Filename: \\?\C:\inetpub\wwwroot\web.config
Line number: <LineNumber>
Error: Cannot add duplicate collection entry of type '<XXX>' with unique key attribute '<YYY>' set to '<ZZZ>'.
Note In this error message, <XXX>, <YYY>, and <ZZZ> are placeholders for unique values that depend on which feature configuration page and which attribute cause this problem.

When you click OK, the feature configuration page does not let you correct the problem in Server Manager.

CAUSE

This problem occurs because IIS detects a duplicate entry for the same setting at a higher level in the configuration. For example, IIS detects a duplicate entry for the same setting at the server level and at the Web site level. Or, IIS detects a duplicate entry for the same setting at the Web site level and at the application level.

RESOLUTION

To resolve this problem, first you must delete the duplicate entry that is defined at the highest level. The highest level may be the server level or the Web site level. After you delete the duplicate entry, the feature configuration page for the Web site or for the application should be displayed correctly. Then, you can modify the configuration at this level, and you can configure the feature configuration page correctly. However, make sure that you do not add duplicate entries.

MORE INFORMATION

Steps to reproduce the problem

  1. Click Start, click Administrative Tools, and then click Internet Information Services (IIS) Manager.
  2. Expand localhost (<ServerName>\<UserName>), expand Sites, and then click Default Web Site.
  3. Double-click HTTP Response Headers.
  4. In the Actions section, click Add.
  5. In the Name box, type tst.
  6. In the Value box, type text/plain, and then click OK.
  7. Click localhost (<ServerName>\<UserName>).
  8. Double-click HTTP Response Headers.
  9. In the Actions section, click Add.
  10. In the Name box, type tst.
  11. In the Value box, type text/plain, and then click OK.
  12. Click Default Web Site, and then double-click HTTP Response Headers.
Note This problem may occur for any configuration section. These steps are an example of one configuration section for which this problem occurs.

APPLIES TO
  • Microsoft Internet Information Services 7.0
Keywords: 
kbtshoot kbpubtypekc kberrmsg kbprb KB949349
 

Article Translations