Linked Questions
15 questions linked to/from Application_Error not firing when customerrors = "On"
78 votes
10 answers
72k views
CustomErrors does not work when setting redirectMode="ResponseRewrite"
In a old site, I was changing the way that CustomErrors works by adding redirectMode="ResponseRewrite" (new in 3.5 SP1): <customErrors mode="RemoteOnly" defaultRedirect="Error.aspx" redirectMode="...
44 votes
2 answers
76k views
Application_Error in global.asax not catching errors in WebAPI
For a project I am working on, one of the things we're implementing is something that we have code for in some of my teams older ASP.NET and MVC projects - an Application_Error exception catcher that ...
39 votes
4 answers
17k views
How to implement proper HTTP error handling in .NET MVC 2?
I've been struggling all day to implement error handling in my ASP.NET MVC 2 app. I've looked at a variety of techniques, but none work properly. I'm using MVC2 and .NET 4.0 (started the project ...
17 votes
4 answers
23k views
global.asax Application_Error not firing
My global.asax seems not to be firing. I have: void Application_Error(object sender, EventArgs e) { // Code that runs when an unhandled error occurs Server.Transfer("~/ExceptionFormView....
13 votes
1 answer
23k views
Is global.asax Application_Error event not fired if custom errors are turned on?
If you have custom errors set to RemoteOnly in web config - does this mean that MVC's application level error event in global.asax - Application_Error is not fired on error? I have just noticed that ...
2 votes
3 answers
4k views
Should you use the method Application_Error in your global.asax in ASP.NET MVC?
I know that in ASP.NET people typically put a protected method called "Application_Error" in their global.asax file inorder to handle say, logging of exceptions. My question is, is this an ASP.NET ...
0 votes
1 answer
2k views
Application_Error event in Global.asax not firing in IIS7, but works fine in IIS6
Last year, we moved our web applications to a new server. Here are the system/application configuration specs prior to the move: Windows Server 2003 IIS 6.0 ASP.NET 4.0 WebForms Here are the specs ...
0 votes
2 answers
2k views
"Internet Explorer cannot display the webpage" instead of YSOD?
When testing my ASP.NET MVC 3 app in Internet Explorer 9, I get the generic "Internet Explorer cannot display the webpage" error instead of the Yellow Screen. The errors get thrown to the Event ...
3 votes
4 answers
773 views
How to handle exceptions that are re-thrown and logged multiple times
I have an issue with the current project I am working on. The developers have added multiple catch blocks for a try block. Each catch is logging the error and then re-throwing it. Something like this: ...
0 votes
1 answer
979 views
Website gives a white page instead of an 404 error
I have this quite strange problem: When I go to a URL which doesn't exist on my website, it simply shows a white page. The Application_Error event is never run, and the user is not transfered to the ...
2 votes
1 answer
554 views
Global.asax only run on debug mode
I have a redirect on global.asax application_error function. When i'm debugging, every exception is treated by the function. When i am running application on web server, appears the error default page ...
0 votes
1 answer
347 views
Accessing the exception if custom redirection redirects to a controller
I am using MVC4, and would like to be able to throw HttpExceptions from a ontroller, and handle those in a seperate controler. I have set up <customErrors mode="On" defaultRedirect="/Error"/> ...
0 votes
1 answer
220 views
Not able to handle 404 errors on an ASP.NET MVC. Why?
I have the following to handle errors on an ASP.NET MVC 5 application: protected void Application_Error() { var exception = Server.GetLastError(); var httpException = exception as HttpException; ...
1 vote
0 answers
222 views
Application_Error event of global.asax is not firing on production server but working on DEV and QA server
Application_Error event is not firing on production server, this production server having Load Balancer. Application_Error event is firing and running well on QA and DEV server only issue is there on ...
0 votes
0 answers
73 views
Application_Error not hit when RemoteOnly
I want to write custom errors and unexpected errors via Global.asax. In that method I use : var ex = Server.GetLastError(); to obtain the error which ocurred. However, this code is not hit (or ...