I have an Asp.Net 4.0 Web Forms that throws the following error at a specific time
"Server Error in Application / MySiteDev."
This error only occurs from time to time. And this error does not trigger the Application_Error event, which is processed in Global.asax .
Since Application_Error is not triggered, what are all the other possible places that will have a log of this error event? Anything other than watching events?
Any way to find out the exceptions handled by the ASP.Net framework?
Note: customErrors mode="Off" . Also runAllManagedModulesForAllRequests="true"
UPDATE
Link from How to handle application level errors
The error handler defined in the Global.asax file will catch errors that occur during processing of requests in the ASP.NET runtime. For example, it will catch an error if the user requests a .aspx file that is not found in your application. However, it does not detect an error if the user requests a nonexistent .htm file. For nonASP.NET errors, you can create a custom handler in IIS. A custom handler will also not be called for server-level errors.
You cannot directly display error information for queries from the Global.asax file; you must transfer control to another page, usually a web forms page. When transferring control to another page, use the transfer method. This saves the current context so that you can get error information from the GetLastError method.
After processing the error, you must clear it by calling the ClearError method of the Server object (class HttpServerUtility).
CODE
protected void Application_Error(object sender, EventArgs e) { //Get the exception object Exception exception = Server.GetLastError().GetBaseException(); //Get the location of the exception string location = Request.Url.ToString(); if (!String.IsNullOrEmpty(location)) { string[] partsOfLocation = location.Split('/'); if (partsOfLocation != null) { if (partsOfLocation.Length > 0) { location = partsOfLocation[partsOfLocation.Length - 1]; } } //Maximum allowed length for location is 255 if (location.Length > 255) { location = location.Substring(0, 254); } } string connectionString = ConfigurationManager.ConnectionStrings[UIConstants.PayrollSQLConnection].ConnectionString; ExceptionBL exceptionBL = new ExceptionBL(connectionString); exceptionBL.SubmitException(exception.Message, location); Log.Logger.Error(exception.Message); }
Config
<system.web> <compilation debug="true" targetFramework="4.0" /> <pages validateRequest="false"></pages> <httpRuntime requestValidationMode="2.0" /> <customErrors mode="Off"/> <authentication mode="Windows"></authentication> <identity impersonate="true" userName="domain\xxxx" password="xxxx"/> </system.web> <system.webServer> <modules runAllManagedModulesForAllRequests="true"/> <httpErrors errorMode="Detailed" /> </system.webServer>
UPDATED LINKS