I am new with Visual studio 2013 and I am currently working on two projects started by another developer. With one project the view option works fine using IIS Express, but the second one gives me error 500 with the below details...
"HTTP Error 500.19 - Internal Server Error. The requested page cannot be accessed because the related configuration data for the page is invalid."
"Config Error: Cannot add duplicate collection entry of type 'add' with unique key attribute 'name' set to 'Access-Control-Allow-Origin'"
Config Source:
<customHeaders>
<add name="Access-Control-Allow-Origin" value="*" />
<add name="Access-Control-Allow-Headers" value="Content-Type" />
Hope somebody knows about an error like this and how I can solve it. Thanx in advance
I suspect IIS is already sending an Access-Control-Allow-Headers by default and that is blowing up.
Typically when setting custom headers one usually does a prophalactic removal first:
<customHeaders>
<remove name="Access-Control-Allow-Origin" />
<remove name="Access-Control-Allow-Headers" />
<add name="Access-Control-Allow-Origin" value="*" />
<add name="Access-Control-Allow-Headers" value="Content-Type" />
</customHeaers>
This insures your app works no matter what happened upstream in configuration.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments