I have an MVC 4 application in which the base controller overrides the OnException method as below. Everything works fine in development (IIS Express 8.5) but the method is not called once the app is deployed to production (2012 R2/IIS 8.5). The user sees the standard YSOD error message.
public override void OnException(ExceptionContext filterContext)
{
//Code here
}
I have confirmed that the web.config files for both applications are identical. The CustomErrors section of the web.config file is set to "On"
<customErrors mode="On" />
I have compared the application files very carefully and there are no differences in the deployments. I am expecting the issue is in an IIS setting that I cannot seem to locate via Google or by poking around.
Thanks for your help!