I need to restart my mvc4 web application programmatically. But System.Web.HttpRuntime.UnloadAppDomain() doesn't work.
What is the best way to restart asp.net mvc application? Please mind that changing web.config content or folder names doesn't solve my problem.
this code work for me. just call it to reload application.
System.Web.HttpRuntime.UnloadAppDomain();
More info
This method will just unload our application. If you just put this method in an ASP.NET web button you are totally done. So when will our application reloaded? Actually if you click your button it will first launch our method and unload application. Further on the web page we are on at that moment will be reloaded as well, because we just clicked a button and the web page should refresh. After launching our method the page refresh process will cause our application to reload as well.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With