I wonder if there is a way to shutdown/exit/stop an ASP.NET MVC web application from code? In my global.asax.cs
--> Application_Start()
method I am checking some prerequisites like a working database connection etc., if one of them is not met, I want the application to shutdown and give an error. How can I do that? Is it even possible at all or can this only be done from "outside" (e.g. IIS management console or similar)?
Asked
Active
Viewed 1,211 times
0

Rob
- 11,492
- 14
- 59
- 94
-
possibly dublicate of [this](https://stackoverflow.com/questions/29843418/how-can-i-programmatically-stop-the-current-website) can help aslo – Syed Muhammad Munis Ali Jan 22 '18 at 08:56
-
1That solved it, thanks! – Rob Jan 22 '18 at 08:58
-
upvote if help ;) – Syed Muhammad Munis Ali Jan 22 '18 at 09:00