Cannot add a repeating collection item of type ' MimeMap ' when the unique key property ' FileExtension ' is set to '. Log '

Source: Internet
Author: User

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 '

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.