Application_error event not firing after publishing

KhD

Joined
Jul 21, 2011
Messages
2
Reaction score
0
I know this has been asked a lot of times, but I could not get things working from those posts.

I have implemented Application_error method in Global.asax file to log and send email for all unhandled exceptions. This works perfectly fine when running on Visual Studio, but as soon as I publish it to the test server, the Application_event stops firing. No log entry is made to the text file and no email is sent.

PrecompiledApp.config file is present in the root directory, along with App_global.asax.compiled, App_global.asax.dll in the bin folder. Global.asax file is not present after I publish the website.

I have tried removing PrecompiledApp.config file, but it doesn't work. I have tried adding Global.asax file to the root directory, but doesn't work. I have tried with

Code:
<customErrors mode="Off"  />

and

Code:
<customErrors mode="On" defaultRedirect="Error Page.aspx" />

in web.config file....nothing works.

I added a line to Page_load of a page:

Code:
Response.Write("<br/>ApplicationInstance: " +  Context.ApplicationInstance.GetType().FullName);

It returns ApplicationInstance: ASP.global_asax, which should be returned according to a post. Then why is the event not firing?

Please Help!!!

Thanks!!!
 

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

Forum statistics

Threads
473,731
Messages
2,569,432
Members
44,835
Latest member
KetoRushACVBuy

Latest Threads

Top