In the case of a .NET webforms application being deployed, is there any way to warn the user that the system is being updated?
In the case of a .NET webforms application being deployed, is there any way to warn the user that the system is being updated?
If you are working with IIS
simply add your maintenance page with the following name app_offline.htm
. While this file is at the root of your site all requests will be redirected to it. Once deployed, remove the file and the website will respond with your application again.
But keep in mind that the moment you publish this file to the root of your site, your application will stop and "take down" all users, sessions, and application variables defined in runtime.
The great advantage is that any requested url will be redirected to that page.
Edit
I had not used this technique in a long time and had never that if the website is stopped you will receive a 404 error and during the recycle of the pool, you will receive a 503.
So if the expected result is not to display errors in any case for the user. You may need to make a another structure its unavailability screen, using
app_offline.htm
, with a new application pool and pointing this out root directory of your site, while deploying the new version.