Visual Studio 2013 gives "Cannot add duplicate collection entry of type ‘mimeMap’"

visual studio 2013 community
visual studio 2013 free download
visual studio 2013 sp3
visual studio 2013 update
visual studio 2013 update 5 is available
visual studio 2015
visual studio 2017
visual studio 2012

I have a site that was built using Visual Studio 2010. When I upgraded to Visual Studio 2013, on some pages I would get an error that said:

Cannot add duplicate collection entry of type 'mimeMap' with unique key attribute 'fileExtension' set to '.mp4'.

After some searching, I found a helpful post on a blog, but since the issue was a little different and I didn't find it on stackoverflow, I thought I'd post the question and answer here.

The issue was that when I switched to Visual Studio 2013, the web server used for debugging changed. Visual Studio 2013 uses IIS Express by default. Although Visual Studio 2010 SP1 supports IIS Express, my installation was still using the default Visual Studio Development server.

Like IIS 7, Visual Studio Development Server did not define the mp4 mime type by default, so that's why we had it explicitly added in the web.config, like this:

<system.webServer>
<staticContent>
  <mimeMap fileExtension=".mp4" mimeType="video/mp4" />
</staticContent>
</system.webServer>

IIS Express, on the other hand, is based on IIS 8, and IIS 8 defines the mp4 mime type, and many others, by default. So when the mimeMap is explicitly set in the web.config, it is considered a duplicate.

If you DO NOT need to support IIS 7 in your production environment, then you can just completely remove the mimeMap tag from the web.config. If you need to support BOTH IIS 7 and IIS 8, then you can use a remove tag for the mimeMap first and then set it again, like this:

<system.webServer>
<staticContent>
    <remove fileExtension=".mp4" />
    <mimeMap fileExtension=".mp4" mimeType="video/mp4" />
</staticContent>
</system.webServer>

In IIS 7 the removal will do nothing since it isn't already defined, but in IIS 8 it will remove the original so that the new one is not a duplicate. Thanks to Oliver Payen for his post on the IIS 7 and IIS 8 difference and the remove solution.

Visual Studio 2013 New Editor Features, In Visual Studio 2013, we have introduced new features that boost These features are a result of the feedback you gave us through User� Visual Studio 2013 gives Build Warning MSB3247: Found conflicts between different versions of same dependent assembly. Visual Studio Development > MSBuild.

Simply remove extension before add it.

<remove fileExtension=".mp4" />
<mimeMap fileExtension=".mp4" mimeType="video/mp4" />

What's New in the Visual Studio 2013 IDE | Build 2013, With Visual Studio 2013 it just gets better when your IDE is connected. New roaming support, notifications and a new Visual Studio Updates� Visual Studio 2013 Gives Exceptions at Memset function while using DirectX 9. Visual Studio Languages , Windows Desktop Development > Visual C++.

In my case, I solved the problem just by removing the line that was doing duplicate stuff:

 <configuration>
    (...)
    <system.webServer>
        <staticContent>
            <!--mimeMap fileExtension=".json" mimeType="application/json" /-->
        </staticContent>
    </system.webServer>
 </configuration>

New Features in Visual Studio 2013, With the introduction of Visual Studio 2013, Microsoft has provided us Enhanced Scrollbar: It gives us an aerial view of the currently open� Visual Studio 2013 and earlier. Install the appropriate version of Python Tools for Visual Studio for your version of Visual Studio: Visual Studio 2013: PTVS 2.2.2 for Visual Studio 2013. The File > New Project dialog in Visual Studio 2013 gives you a shortcut for this process. Visual Studio 2010 and 2012: PTVS 2.1.1 for Visual Studio 2010 and 2012

Visual Studio 2013 Color Theme Editor, The error message is pretty explicit, the path is too long for copying the file to, it exceeds 248 characters. You should put the output of your� Allows users to customize the Visual Studio 2013 color palette. This extension is supported for Visual Studio 2013 Professional and higher. ThisChannel 9 video gives an in-depth description of how to use the extension. Screenshots. New in 2013. New themes based on Ethan Schoonover's Solarized color palette; Import and upgrade themes from Visual

When I try to publish website in visual studio 2013 gives an error , WriteLine($ keeps giving me an error. I am using Visual Studio 2013 and cant seem to get this to work properly. Instead what i have to do is� This update for the Microsoft Visual C++ 2013 Update 5 Redistributable Package is released as a download-only update and isn’t distributed through Windows Update. Redistribution of this update is allowed, subject to the same license terms as granted by the Microsoft Visual Studio 2013 Update 5 release.

C#: Interpolated Strings- Visual Studio 2013?, 5: Scroll Bar Customization In Visual Studio 2013, the scroll bar can now be customized to give you a better overview of large files. It can be set� Visual Studio dev tools & services make app development easy for any platform & language. Try our Mac & Windows code editor, IDE, or Azure DevOps for free.

Comments
  • Grrrr... I got this issue (and most of my Angular controllers stopped loading) when I upgraded from VS2013 to VS2015. Adding this <remove> line fixed it. Thank you very much !!
  • After updating Visual Studio 2019 to 16.4.2 I got a: HTTP Error 500.19 – Internal Server Error HRESULT: 0x800700b7 Microsofts Support page (support.microsoft.com/en-us/help/942055/…) says to edit the applicationHost.config file, but the mentioned fix was NOT to be found within that page or file. Editing the web.config file and adding <remove mimeMap> did the trick. Thanks a million.
  • ... which is great if you don't have to deploy to IIS 7. @Pedro's solution works in IIS 8 and up (depending on the fileExtension).