If you already have both the. xaml and. xap extensions in IIS, then IIS prompts you to add Duplicate collection items of type "MimeMap" when the unique key attribute "FileExtension" is set to ". xaml" (or. xap).
<staticContent> <mimemap fileextension=". JSON" mimetype=" Application/x-javascript" /> </staticContent>
The specific hint is based on the extension of the MIME type you added, for example, I added the. JSON, so the hint is. JSON this extension cannot add duplicate collection items
So generally we want to add MIME Type to the configuration file, we have to use the Remove node to remove the mime to be added to prevent duplication. The correct configuration file code is as follows:
<staticContent> <remove fileextension=". JSON"/> <mimemap fileextension=". JSON" mimetype="application/x-javascript" /> </staticContent>
Generally speaking The reason we want to add MIME types to the Web. config for the ASP is because the MIME type is not set in IIS, and for some reason we can only add MimeMap in the Web. config profile of our website (e.g. we do not have access to the server, etc.).
This can be problematic: assuming that the current Web site is published to a new server, IIS on the new server has already set this MIME type by default, and our web site The Web. config profile also sets the mimetype for MimeMap, so adding the MIME type repeatedly prompts MimeMap to repeat in the collection project settings!
Cannot add a repeating collection item of type ' MimeMap ' when the unique key property ' FileExtension ' is set to '. Log '