开发者

Get full error in Release mode in MVC3

开发者 https://www.devze.com 2023-03-10 18:18 出处:网络
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:

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号