Click here to Skip to main content
15,891,777 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a web.config file with following section
<system.webServer>
       <httpProtocol>
      <customHeaders>
        <add name="Cache-Control" value="no-cache"/>
        <add name="Pragma" value="no-cache"/>
        <add name="Expires" value="-1"/>
        <add name="X-UA-Compatible" value="IE=Edge,chrome=1"/>
      </customHeaders>
    </httpProtocol>
  </system.webServer>


When the website accessed in IIS it gives this error : Cannot add duplicate collection entry of type 'add' with unique key attribute 'name' set to 'Cache-Control' this was on production site.

I tried to reproduce this in house by adding same section to following configuration files:

C:\Windows\System32\inetsrv\config\applicationHost.config file.
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config\web.config

But above steps did not work.
Is there some other global configuration file that needs to be set to reproduce this issue?
This is part of my investigation to find the cause of this error.

Thanks in advance

What I have tried:

I tried to reproduce this in house by adding same section to following configuration files:

C:\Windows\System32\inetsrv\config\applicationHost.config file.
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config\web.config

But above steps did not work.
Posted
Updated 15-Mar-17 2:50am

1 solution

 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900