IIS 7 and Above
Cannot add duplicate collection entry of type 'add' with unique key a...
Last post Jun 25, 2012 08:36 PM by mkamoski2
Jun 25, 2012 07:47 PM|mkamoski2|LINK
Jun 25, 2012 08:19 PM|peterviola|LINK
Take a look at this KB Article:
I'm not sure why you can't remove the entry manually if you stop IIS. Close IIS Manager. Go to services.msc and top the web publishing service. Then try to edit the file to remove the duplicate entry.
Make sure you are editing the file using a user account with permissions to edit the file.
Jun 25, 2012 08:36 PM|mkamoski2|LINK
Dear PeterViola --
OK, that worked great, but with one minor twist.
The article referenced says this...
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.
...and that IS what I was doing but I could not save the "web.config" file due to an Access Denied message, despite having run "iisreset /stop" and making sure the Publishing service was stopped.
Then, on a lark, I decided to try to something DOS based rather than save the file from NotePad.
I opened "web.config" with NotePad and edited it but I saved it to "C:\Temp\web.config".
Then from a DOS command line opened "As Administrator", I ran....
copy c:\temp\web.config c:\inetpub\wwwroot\web.config
...and got the great news of...
1 file(s) copied
...and then IIS worked fine when viewing the "Default Document" settings for all sites.
So all is well and I thank you for you kindness.
-- Mark Kamoski