Error: You can not duplicate mimeMap collection item with unique key attribute in ASP.Net

Last Reply one year ago By abhi619

Posted one year ago

I have a website which I am trying to host locally on Window 10 where CSS and JS not working and it is throwing 500: internal server error to load css and js files. 
I have tried it on another server with different IIS version and it is working fine without any issue. but not working for IIS 10.

Solution I tried:
>> I have already tried setting Static Content in IIS config

>> I have tried permission set on files.
but nothing is working.

Please help

Posted one year ago
Hi @abhi619,
Please try the following

HTTP error 500.24 internal server error in IIS

It might help you.

Cheers Andrea.

Posted one year ago

Thanks for your reply Andrea,

I am getting following message

HTTP Error 500.19 - Internal Server Error
The requested page can not be accessed because the related configuration data for the page is invalid.
Detailed error information:
Module : Custom Error Module
Message : Send Response
Handler : StaticFile
error code : 0x800700b7
Configuration : You can not duplicate mimeMap collection item with unique key attribute 'fileExtension' set to '.ogg'
configuration : \\? \ web.config
Requested URL : http://SiteURL/Styles/Site2.css
Physical path : C: \ \ Styles \ Site2.css
login Method : Anonymous
Logged in user : Anonymous

Configuration Source:
    6: <staticContent>
    7: <mimeMap fileExtension = ".ogg" mimeType = "audio / ogg" />
    8: </ staticContent>
More information:
This error occurs when you are reading the configuration file for the web server or web application. The event log may contain more information about the cause of the error.

Posted one year ago

Hi abhi619,

Add below code in your web.config file

    <remove fileExtension=".ogg" />
    <mimeMap fileExtension = ".ogg" mimeType = "audio / ogg" />


Posted one year ago

It worked. Thanks AnandM