ASP.NET MVC错误500当推到生产服务器 [英] ASP.NET MVC Error 500 When Pushed to Production Server

查看:153
本文介绍了ASP.NET MVC错误500当推到生产服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我工作的一个ASP.NET MVC 4在C#项目,它工作得很好我的本地开发服务器上。然而,当我把它推到我的生产服务器,特定的页面给出了一个500内部服务器错误。但是,我得到的错误是没有更多的帮助不是处理您的请求时发生错误。

I am working on an ASP.NET MVC 4 in C# project which works very well on my local development server. However, when I push it to my production server, a particular page gives a 500 internal server error. However, the error I get is no more helpful than "An error occurred while processing your request".

我怎么能强制ASP.NET显示一个更实用的错误,哪怕是死亡的黄色画面?

How can I force ASP.NET to display a more helpful error, even if it is the yellow screen of death?

感谢您的时间。

推荐答案

是的,有死亡的黄色画面。您可以强制它通过转到的Web.Config 文件,并确保你有这样的一行来显示错误:

Yes, there's a Yellow Screen of Death. You can force it to display the error by going to the Web.Config file and making sure that you have this line:

<system.web>
   <customErrors defaultRedirect="GenericError.htm"
    mode="Off"></customErrors>
</system.web>

BUT 必须非常小心,不要离开像这样你找出后问题。这是一个大的安全隐患在生产框中显示错误完整的堆栈跟踪。

BUT be very careful NOT to leave it like this after you figure out the issue. It is BIG a security risk to display full stack traces of errors on a Production box.

这篇关于ASP.NET MVC错误500当推到生产服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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