{"id":358,"date":"2016-09-14T05:17:53","date_gmt":"2016-09-14T05:17:53","guid":{"rendered":"http:\/\/waynenguyen.org\/dev\/?p=358"},"modified":"2016-09-14T05:17:53","modified_gmt":"2016-09-14T05:17:53","slug":"cannot-add-duplicate-collection-entry-of-type-mimemap-with-unique-key-attribute-fileextension-set-to-json","status":"publish","type":"post","link":"https:\/\/bruceng.com\/dev\/?p=358","title":{"rendered":"Cannot add duplicate collection entry of type &#8216;mimeMap&#8217; with unique key attribute &#8216;fileExtension&#8217; set to &#8216;.json&#8217;"},"content":{"rendered":"<p>This issue occurred today while I was trying to run an Ext JS application from IIS, because .json files are not accepted by IIS I tried to add this file extension to the application. But instead I got a 500 error when trying to browse the application.<\/p>\n<p>After some digging and searching the MIME types section of the website and all other applications, I couldn&#8217;t find the conflicting extension.<\/p>\n<p>I was able to solve the issue by editing the application&#8217;s web.config file, right before the mimeMap tag, add a remove tag like following:<\/p>\n<p><span style=\"color: #0000ff; font-family: Consolas; font-size: small;\">&lt;<\/span><span style=\"color: #a31515; font-family: Consolas; font-size: small;\">staticContent<\/span><span style=\"color: #0000ff; font-family: Consolas; font-size: small;\">&gt;<\/span><\/p>\n<p><span style=\"color: #0000ff; font-family: Consolas; font-size: small;\"> &lt;<\/span><span style=\"color: #a31515; font-family: Consolas; font-size: small;\">remove<\/span> <span style=\"color: #ff0000; font-family: Consolas; font-size: small;\">fileExtension<\/span><span style=\"color: #0000ff; font-family: Consolas; font-size: small;\">=<\/span><span style=\"font-family: Consolas; font-size: small;\">&#8220;<\/span><span style=\"color: #0000ff; font-family: Consolas; font-size: small;\">.json<\/span><span style=\"font-family: Consolas; font-size: small;\">&#8220;<\/span><span style=\"color: #0000ff; font-family: Consolas; font-size: small;\">\/&gt;<\/span><\/p>\n<p><span style=\"color: #0000ff; font-family: Consolas; font-size: small;\"> &lt;<\/span><span style=\"color: #a31515; font-family: Consolas; font-size: small;\">mimeMap<\/span> <span style=\"color: #ff0000; font-family: Consolas; font-size: small;\">fileExtension<\/span><span style=\"color: #0000ff; font-family: Consolas; font-size: small;\">=<\/span><span style=\"font-family: Consolas; font-size: small;\">&#8220;<\/span><span style=\"color: #0000ff; font-family: Consolas; font-size: small;\">.json<\/span><span style=\"font-family: Consolas; font-size: small;\">&#8220;<\/span> <span style=\"color: #ff0000; font-family: Consolas; font-size: small;\">mimeType<\/span><span style=\"color: #0000ff; font-family: Consolas; font-size: small;\">=<\/span><span style=\"font-family: Consolas; font-size: small;\">&#8220;<\/span><span style=\"color: #0000ff; font-family: Consolas; font-size: small;\">application\/json<\/span><span style=\"font-family: Consolas; font-size: small;\">&#8220;<\/span><span style=\"color: #0000ff; font-family: Consolas; font-size: small;\"> \/&gt;<\/span><\/p>\n<p><span style=\"color: #0000ff; font-family: Consolas; font-size: small;\"> &lt;\/<\/span><span style=\"color: #a31515; font-family: Consolas; font-size: small;\">staticContent<\/span><span style=\"color: #0000ff; font-family: Consolas; font-size: small;\">&gt;<\/span><\/p>\n<p>I still have no idea why this works, but it works.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This issue occurred today while I was trying to run an Ext JS application from IIS, because .json files are not accepted by IIS I tried to add this file extension to the application. But instead I got a 500 error when trying to browse the application. After some digging and searching the MIME types &hellip; <a href=\"https:\/\/bruceng.com\/dev\/?p=358\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Cannot add duplicate collection entry of type &#8216;mimeMap&#8217; with unique key attribute &#8216;fileExtension&#8217; set to &#8216;.json&#8217;&#8221;<\/span><\/a><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[9,13],"class_list":["post-358","post","type-post","status-publish","format-standard","hentry","category-problems","tag-iis","tag-json"],"_links":{"self":[{"href":"https:\/\/bruceng.com\/dev\/index.php?rest_route=\/wp\/v2\/posts\/358","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/bruceng.com\/dev\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/bruceng.com\/dev\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/bruceng.com\/dev\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/bruceng.com\/dev\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=358"}],"version-history":[{"count":1,"href":"https:\/\/bruceng.com\/dev\/index.php?rest_route=\/wp\/v2\/posts\/358\/revisions"}],"predecessor-version":[{"id":359,"href":"https:\/\/bruceng.com\/dev\/index.php?rest_route=\/wp\/v2\/posts\/358\/revisions\/359"}],"wp:attachment":[{"href":"https:\/\/bruceng.com\/dev\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=358"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bruceng.com\/dev\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=358"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bruceng.com\/dev\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=358"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}