From a fresh MVC 3 Project, I've modified an Index() action to throw an exception. I expect the stock Error.chhtml view to be rendered, because I've set <customErrors mode="On" />
in the web.config. Instead, I still get the "yellow screen of death" while running from within VS.
<system.web>
<customErrors mode="On" />
...
My HandleError attribute is set globally from the global.asax.cs.
public static void RegisterGlobalFilters(GlobalFilterCollection filters)
{
filters.Add(new HandleErrorAttribute());
}
...unmodified, per the default project setup. I've run against both IIS express and VS Dev Server. Nothing causes the custom error page to surface. What am I missing?
I have seen the same problem, which is due to that I added <customErrors mode="On" /> to <root>\Views\Web.config, instead of <root>\Web.config
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