ASP.NET MVC / IIS 7.5:静态内容500内部服务器错误只 [英] ASP.NET MVC / IIS 7.5: 500 Internal Server Error for static content only

查看:283
本文介绍了ASP.NET MVC / IIS 7.5:静态内容500内部服务器错误只的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是ASP.NET MVC项目IIS 7.5下运行(但可能存在于早期版本和非MVC网站的问题)这是previously工作已经开始返回500内部服务器错误,但只有通过静态处理程序处理的内容 - 图片,网页等,通过控制器做工精细用MVC本身处理。

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 Error but only for content handled by the static handler - images, pages etc. handled by MVC itself through a controller work fine.

我知道什么原因造成的 - 我的情况下,别人记录这有同样的问题。

I know what caused it - I am documenting this in case somebody else has the same problem.

推荐答案

我启用失败请求跟踪,并通过(巨大)的日志搜索之后,我发现这一点:

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

 <EventData>
  <Data Name="ContextId">{00000000-0000-0000-3700-0080010000FC}</Data>
  <Data Name="ModuleName">CustomErrorModule</Data>
  <Data Name="Notification">536870912</Data>
  <Data Name="HttpStatus">500</Data>
  <Data Name="HttpReason">Internal Server Error</Data>
  <Data Name="HttpSubStatus">19</Data>
  <Data Name="ErrorCode">2147942583</Data>
  <Data Name="ConfigExceptionInfo">
    \\?\C:\Websites\xxx\www\web.config ( 58) :Cannot add duplicate collection 
    entry of type &apos;mimeMap&apos; with unique key attribute 
    &apos;fileExtension&apos; set to &apos;.woff&apos;
  </Data>
 </EventData>

现在的情况是,新的MIME类型的服务网络字体(.woff)已经明确地添加到网站。

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

后来,新的MIME类型(.woff)也已被添加到全局IIS MIME类型。

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.

这篇关于ASP.NET MVC / IIS 7.5:静态内容500内部服务器错误只的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆