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

abhi619
 
on Sep 01, 2017 01:32 AM
2795 Views

Problem:
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

Download FREE API for Word, Excel and PDF in ASP.Net: Download
Andrea
 
on Sep 01, 2017 01:32 AM
Hi @abhi619,
Please try the following

HTTP error 500.24 internal server error in IIS

It might help you.

Cheers Andrea.
abhi619
 
on Sep 01, 2017 01:36 AM

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.

AnandM
 
on Sep 01, 2017 01:41 AM

Hi abhi619,

Add below code in your web.config file

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

 

abhi619
 
on Sep 01, 2017 02:04 AM

It worked. Thanks AnandM