简体   繁体   中英

How to Automate ASP.NET Website Downtime message

I have a requirement where I want to Automate a message when the (ASP.Net) website is down for scheduled maintenance on specific times throughout the week.

Eg Mon - 09:00 am to 11:00 am, Sat: 01:00 am to 03:00 am.

At the moment we have the message hard-coded. We uncomment it when we need the downtime and comment it out again when we don't need it.

What is the best options to take care of this.

Its a ASP.NET C# web application.

Any good suggestions. Bring them on....

EDIT

I think my requirement was not clear to you guys. Right now we display a Downtime message 24 hrs before the scheduled downtime. I want to automate that part. Windows Service / Scheduled job is definitely in my radar. I want to check if there are any decent / sophesticated ways of doing that. I am a Windows Developer so not that strong on ASP.NET.

ASP.NET applications will be automatically taken down when a file named app_offline.htm is added to the root folder of the application. Any request for the web site will display the app_offline.htm. ScottGu posted more information in his blog .

To automate this, you can have a Windows scheduled batch process add and remove the file or you can have your CI build server do it.

Either way, I believe this is the simplest way to bring down an ASP.NET application.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM