Last night we upgraded from ASP.NET 1.1 to ASP.NET 2.0. I have noticed that our Application_Error handler is not firing from Global.asax.
In visual studio we have a class, Epic.Web.Global. See source code below. The Application_Error is not firing but instead a log is written to the windows event log regarding the unhandled exception.
We used VS 2008 to upgrade our project from VS 2003 but the actual Global.asax file has never been part of our VS project file -- it's just a file we dropped on IIS in the application root directory. The compiled Epic.Web.DLL file is dropped in application root\bin directory.
I have since tried adding a new Global.asax file to the VS project but then it wants to do a code behind file and drop the .cs file in App_Code. I don't want to do that -- I want to use our DLL using inherits in Global.asax but I haven't figured out how to make it work.
This worked fine in .NET 1.1 and should be simple but I haven't found the quirk yet. I have found articles on here and on google regarding people with similiar problems but haven't found an answer that works for us. There was something regarding PrecompiledApp.config but it's not a file we have. We have web.config and it does have custom errors turned on.
Our Global.asax file:
<%@ Application Language="C#" Inherits="Epic.Web.Global" %>
Our Global.cs file:
public class Global : System.Web.HttpApplication
protected void Application_Error(object o, EventArgs e)
Exception exception = Server.GetLastError();
// do work
Server.ClearError(); // tried with and without this