Get full error in Release mode in MVC3
My MVC3 application that works fine in Debug
is failing in Release
mode. But the biggest problem is that the error I'm getting is not detailed at all. This is all I'm getting:
Sorry, an error occurred while processing your request.
I have configured elmah
and 开发者_JS百科was expecting to see a full error report, including stacktrace, there, but there's nothing.
How can I get a proper error report?
After @tvanfosson comment, I realized I hadn't configured MVC3 to pass exceptions to elmah
. Found this tutorial on how to do it, and right on Part 1 it suggests to comment this line from Global.asax.cs:
public static void RegisterGlobalFilters(GlobalFilterCollection filters)
{
//filters.Add(new HandleErrorAttribute());
}
That did it. Getting the YSOD now, and elmah
correctly captures the exception.
精彩评论