What happens if an unhandled exception is thrown in Application_Start?

早过忘川 提交于 2019-12-04 23:30:42

Application_Start will be fired only once for each web application so in your case, the start will not happen again for subsequent requests.

Typically, I prefer to put one time start-up code in the application start within try-catch and if there is an exception then set the global error flag. In each BeginRequest, the flag is checked and if it is set, user is redirected to a custom error page indicating the site is down and please contact the administrator.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!