I am trying make work custom error page in asp mvc 5 but for some strange reason at moment to test my page, from elmah i am loging two errors ( the real error what i am testing and a error related with error page not found:
The view 'Error' or its master was not found or no view engine supports the searched locations. The following locations were searched: ~/Views/HotTowel/Error.aspx ~/Views/HotTowel/Error.ascx ~/Views/Shared/Error.aspx ~/Views/Shared/Error.ascx ~/Views/HotTowel/Error.cshtml ~/Views/HotTowel/Error.vbhtml ~/Views/Shared/Error.cshtml ~/Views/Shared/Error.vbhtml
I was looking into this url http://doingthedishes.com/2011/09/10/custom-errors-mvc-3-elmah.html, where the author had the same issue but with asp.net mvc 3. After read it, I tried remove the call to HandleErrorAttribute:
public class FilterConfig
{
public static void RegisterGlobalFilters(GlobalFilterCollection filters)
{
//filters.Add(new HandleErrorAttribute());
}
}
But the issue is still there: i can see my custom page but asp.net mvc is throwing two exceptions. Any help?
the solution is rewrite a class derived from HandleErrorAttribute ? like this post: keep getting The view "Error" not found when using Elmah and asp.net mvc 4 ?