简体   繁体   English

即使Application_Error完成,asp.net应用程序仍保持运行

[英]asp.net application keeps running even after Application_Error finishes

即使在调用Application_Error事件之后,应用程序仍保持运行,是否有任何方法可以在该事件本身中终止应用程序

That would be bad design IMO. 这将是设计不良的IMO。 Unlike desktop applications, ASP.NET applications gracefully deal with unhandled exceptions by allowing the application to keep running. 与桌面应用程序不同,ASP.NET应用程序通过允许应用程序继续运行来优雅地处理未处理的异常。 If it didn't, the website would no longer accept incoming requests, is that what you really want to do? 如果没有,该网站将不再接受传入的请求,这就是您真正想要做的吗?

"After the Page_Error is called, the Application_Error sub is called. Here you can also log the error and redirect to another page . I won't explain anything else about it because it is basically the same as the Page_Error but happens to be at the application level rather than the page level." “在调用Page_Error之后,将调用Application_Error子项。 在这里,您还可以记录该错误并重定向到另一个页面 。由于它与Page_Error基本相同,但碰巧在应用程序级别而不是页面级别。”

Have a look at this web application error handling suggestions . 看看这个Web应用程序的错误处理建议

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Asp.net mvc 覆盖基础 controller 中的 OnException 不断传播到 Application_Error - Asp.net mvc override OnException in base controller keeps propagating to Application_Error asp.net中的Application_Error与Context_Error - Application_Error vs Context_Error in asp.net 如何从ASP.NET MVC 2中的Application_Error重定向? - How to redirect from Application_Error in ASP.NET MVC 2? 如何在Application_Error()中知道asp.net中的请求是ajax - How to know if the request is ajax in asp.net in Application_Error() ASP.NET MVC如何在不重写URL的情况下处理Application_Error的404错误 - ASP.NET MVC how to handle 404 error from Application_Error without rewriting the URL 使用路由的ASP.NET 4 Web窗体-错误时未调用Application_Error - ASP.NET 4 Web Forms Using Routing - Application_Error Not Called on Error Application_Error中的ASP.net Global.asax错误详细信息 - ASP.net Global.asax error detail in Application_Error ASP.NET MVC自定义错误处理Application_Error Global.asax? - ASP.NET MVC Custom Error Handling Application_Error Global.asax? 即使清除错误也无法从Application_Error重定向 - Cannot redirect from Application_Error even after clearing the error 您是否应该在ASP.NET MVC的global.asax中使用方法Application_Error? - Should you use the method Application_Error in your global.asax in ASP.NET MVC?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM