Answered by:
Application_End trigger reason

Question
-
User1417140358 posted
I have a web service hosted on Windows Server 2008. I made sure to turn off all the ways to recycle the IIS. Still inconsistently I am seeing Application_End event getting triggered in my Web Service application (Global.asax).
I went through Event Viewer, custom log files created in Catch block, Debug Diagnostic tool but no luck.
Rarely I see Application_Error event occurred.
In Global.asax file I tried putting below code to log but lo luck.
System.Exception ex = Server.GetLastError().GetBaseException(); LogInfo(ex.ToString()); //Your own logging function... Server.ClearError();
Is there any other way to find the reason why Application_End event is getting triggered?
Thursday, December 13, 2012 10:18 AM
Answers
-
User-861818263 posted
As per by default setting([default settings - Rapid Fail]) of IIS7.5 , application pool will recyle after certain amount of error. May be that's why your application_end is calling again and again after certain time period
Please put apllication_error on global.asax And check if there is error you can catch up of check event viewer.
protected void Application_Error(Object sender, System.EventArgs e) { System.Exception ex = Server.GetLastError().GetBaseException(); LogInfo(ex.ToString()); //Your own logging function... Server.ClearError(); }
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Friday, December 21, 2012 5:55 AM
All replies
-
User-1000095884 posted
Hi sandeepmgupta,
Suggest you take a look at this thread that talks on the reasons when Application_End event fires and check if you have meet one.
http://forums.asp.net/t/1481711.aspx/1
Best Regards.
Friday, December 14, 2012 5:01 AM -
User1417140358 posted
I have already gone through all the cases mentioned there. Still not able to figure out the exact issue. That' why looking for some expert help.
Friday, December 14, 2012 5:37 AM -
User-861818263 posted
As per by default setting([default settings - Rapid Fail]) of IIS7.5 , application pool will recyle after certain amount of error. May be that's why your application_end is calling again and again after certain time period
Please put apllication_error on global.asax And check if there is error you can catch up of check event viewer.
protected void Application_Error(Object sender, System.EventArgs e) { System.Exception ex = Server.GetLastError().GetBaseException(); LogInfo(ex.ToString()); //Your own logging function... Server.ClearError(); }
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Friday, December 21, 2012 5:55 AM