ASP.NET MVC / IIS 7.5: 500 Internal Server Error for static content only

后端 未结 3 991
甜味超标
甜味超标 2021-02-13 10:30

An ASP.NET MVC project running under IIS 7.5 (but problem may exist on earlier versions and non-MVC sites) which was previously working has started returning 500 Internal Server

3条回答
  •  有刺的猬
    2021-02-13 10:39

    I enabled Failed Request tracing and after searching through the (enormous) log, I discovered this:

     
      {00000000-0000-0000-3700-0080010000FC}
      CustomErrorModule
      536870912
      500
      Internal Server Error
      19
      2147942583
      
        \\?\C:\Websites\xxx\www\web.config ( 58) :Cannot add duplicate collection 
        entry of type 'mimeMap' with unique key attribute 
        'fileExtension' set to '.woff'
      
     
    

    What has happened is, a new Mime type for serving web-fonts (.woff) had been explicity added to the site.

    Later on, the new Mime type (.woff) had also been added to the global IIS mime types.

    Instead of the website setting overriding the global setting, an exception was being thrown.

提交回复
热议问题