ASP.NET MVC Error 500 When Pushed to Production Server

天大地大妈咪最大 提交于 2019-12-11 02:47:02

问题


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".

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

Thank you for your time.


回答1:


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 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.



来源:https://stackoverflow.com/questions/23297449/asp-net-mvc-error-500-when-pushed-to-production-server

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!