简体   繁体   中英

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 of the IIS. I have IIS7 and Visual Studio 2005.

Best regards!

IIS actually also has a fourth type of error page it can show. This page will be returned when you configure HTTP Errors to use a custom error page and a problem occurs when IIS tries to render it.

When IIS received a request for a given page in the demo application, it passes it to the ASP.NET runtime to be handled. The runtime generates a response which IIS then examines. IIS will potentially take action and replace this response if the response has an HTTP status code that is an error status code. - If existingResponse is set to PassThrough, IIS takes no action and the response is returned unaltered. - If existingResponse is set to Replace, IIS replaces the response with its own, according to the value of the errorMode attribute so it will either replace it with a detailed, a basic, or a custom error page. - If existingResponse is set to Auto, IIS replaces the response generated by ASP.NET with its own, unless something called the SetStatus flag is set. (I will discuss that flag later in this post.)

http://perspectivespace.com/error-handling-in-aspnet-mvc-3-part-2-custom

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM