问题
So I just moved an existing web project over to Visual Studio 2015 Community Edition which I had started back in VS2013 Ultimate and upon running it in the browser all of the styling was missing and no images were showing up. All of the content worked however and I could navigate the site, until I tried to open a picture and I got the error:
HTTP Error 500.19 - Internal Server Error
Config Error Cannot add duplicate collection entry of type 'mimeMap' with unique key attribute 'fileExtension' set to '.woff2'
Config File \?\C:\Users\me\Documents\Visual Studio 2015\Projects......\web.config
回答1:
I realized that I had added the Mimetype to my web.config and apparently now that things run on IIS Express 10.0 it has an error because it already has that Mimetype. I found this solution on a blog which was to simply remove the Mimetype before adding it so as to retain compatibility on older IIS. Here is the relevant web.config section:
<system.webServer>
<staticContent>
<remove fileExtension=".woff2" />
<mimeMap fileExtension=".woff2" mimeType="application/font-woff" />
</staticContent>
and voila! Works in IIS 10 now and still works in IIS 8.5
来源:https://stackoverflow.com/questions/32212688/loading-web-project-in-vs2015-no-styling-or-images