I just deployed an ASP.NET MVC 3 application to our staging server. Whenever an error occurs, I cannot get the detailed error information, i.e. the "yellow screen of death." Instead, I just get a simple "Sorry, an error occurred while processing your request." message.
My Web.config does include the customErrors off, i.e.:
<system.web>
<compilation debug="true" targetFramework="4.0">
<assemblies>
...
</assemblies>
</compilation>
<customErrors mode="off"/>
</system.web>
In this case, I know exactly what the underlying error is. (I forgot to set permissions on a stored procedure.) But I really want to (re)enable the error handling so I can find these bugs quickly. Of course, I will remove this once we actually go live for security reasons.
What other settings are there that could be overriding the default ASP.NET error handling?
<customErrors mode="Off"/>
The "Off" must be capitalized correctly.
From "Editing ASP.NET Configuration Files":
Case-Sensitivity
Because tags must be well-formed XML, the tags, subtags, and attributes are case-sensitive. Tag names and attribute names are camel-cased, which means that the first character of a tag name is lowercase and the first letter of any subsequent concatenated word or words is uppercase. In most cases, string attribute values are Pascal-case, which means that the first character is uppercase and the first letter of any subsequent concatenated word or words is uppercase. Exceptions are true and false, which are always lowercase.
Remember kids, you learn something new every day. Even if what you learn is lame.
You may have HandleErrorAttribute
global filter in your Global.asax.cs
file. Remove that line.
public static void RegisterGlobalFilters(GlobalFilterCollection filters)
{
filters.Add(new HandleErrorAttribute());
}
A better, long term solution may be to add Elmah to your project, it adds detailed logging to your web project.
Including:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With