I have an ASP.NET MVC application that should catch all unhandled exceptions in the global.asax application error handler.
If I define a handler as follows:
protected void Application_Error(object sender, EventArgs e)
then it works great. However, if in the Application_Start event I try to execute:
this.Error += new EventHandler(Application_Error);
The actual event is never called.
Does anyone know why and if so, what am I doing wrong?
source
share