[英]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.