App Settings: Cannot add duplicate collection entry of type 'add' with unique key attribute 'key'
Symptoms
When you scan the App Settings for an application on an IIS Server you may see the following error:
Cannot add duplicate collection entry of type 'add' with unique key attribute 'key'.
Cause
This error is caused by a misconfiguration of the Web.Config file for the application where duplicate App Setting values have been set.
More Information
It is possible to replicate the issue by selecting the application in IIS Manager and then opening the Application Settings.
The following error will be displayed.
Opening the Web.Config file for the application it is possible to view the duplicate settings in the appSettings section.
Resolution
- Remove the duplicate App Setting in the Web.Config file.
- or -
- Configure the optional components to tolerate this issue.