Alex Rivera | Logout

global.asax Application_Error not firing

Asked 2010-09-15T00:47:50.620
17

My global.asax seems not to be firing. I have:

void Application_Error(object sender, EventArgs e) 
{ 
    // Code that runs when an unhandled error occurs
    Server.Transfer("~/ExceptionFormView.aspx");
}

In my web.config, I don't have anything like CustomErrors. As I want everything to be handled by Global.asax and transferred to ExceptionFormView.aspx.

It works fine locally, but not when we deploy to servers. Any thoughts?

Do I need PrecompiledApp.config?

Edit
Report

2 Answers

4

If you are using IIS 7, try setting:

Response.TrySkipIisCustomErrors = true;
answered 2012-02-03T21:38:38.137
0

In IIS7, the application pool is integrated. It needs to be classic: http://praveenbattula.blogspot.com/2009/12/iis-7-managed-pipeline-mode-globalasax.html

answered 2010-09-15T01:04:08.210

Your Answer