Don’t Mess with App_Offline
One of the most useful features of ASP.NET is the “App_Offline.htm” . It provides a much easy way to make the ASP.NET application offline while we do our modifications on the site.
How we do it?
We just create a file and name it exactly as ‘app_offline’ and place it in the root of a web application directory that we have configured within IIS., This will make the site offline, unload the application domain from the server, and stop processing any new incoming requests for that application.It will serve the contents of the app_offline.htm file in response to all new dynamic requests for the application.
How we make the site online?
Once we rename/remove the App_offline.htm file, the next request into the application will cause ASP.NET to load the application and app-domain again, and it will be back to normal.
This feature is first introduced in ASP.NET 2.0 and it is available now in all the later versions.
<html> <head> <title>Application is not available</title> </head> <body> This application is temporarily not available. Please try again later </body> </html>
This post is specially for Gaurav Raj. Please share your feedback.