Application_Error event only fires on development server

D

David Herbst

VS 2005 / .NET 2.0
Windows 2000 Server sp4 (on development as well as testing server)
Using Web Deployment Project to build assemblies for testing and
production servers.

I added a Global.asax file to my web site so I could implement a
Application_Error() handler. The handler works fine on my development
web server but when I deploy it to the testing web server it doesn't
execute. Instead I get the detailed ASP.NET error page or my
customErrors page depending on the mode setting.

I saw another post which mentioned that this can be caused if
App_Code.compiled and App_global.asax.compiled are not deployed to the
server so I have deployed them to the testing server as well as
App_global.asax.dll but the event still doesn't fire.

On my local development server I tried creating a web site the points
to the Release directory of the Web Deployment Project since these are
the same binaries that are running on the test server.
Application_Error fires as expected.

Here is my code (which works on my local development machine):
void Application_Error(object sender, EventArgs e)
{
// This has been simplified since I am troubleshooting.
Context.ClearError();
Response.Clear();
Response.Write("Application_Error" + "<br/>");
}
 
D

David Herbst

It turns out that I need to deploy yet another file file that wasn't
necessary prior to my usage of Global.asax. This file is
PrecompiledApp.config. I couldn't find any documentation on this file
or the App_Code.compiled and App_global.asax.compiled files and the
rest of my web site has been working happily without them so I hadn't
previously deployed them. Now that I have deployed all three of these
files, Application_Error() is working!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,185
Members
46,736
Latest member
AdolphBig6

Latest Threads

Top