Learn how to use Asp .Net Core’s framework feature or code your own implementation

How To Implement A “Maintenance Mode” in ASP.NET Core

Edwin Klesman
4 min readApr 7


A tutorial with code examples showing you how to use ASP.Net Core’s “App Offline file” method for easy maintenance mode, and how to implement your own maintenance mode for those scenarios where you want to have more control or add actions (i.e.: logging or informing people) to the maintenance mode.

In this article, you will both learn how to put your asp.Net Core app into maintenance mode using the framework’s “App offline file” feature, and how to implement your own maintenance mode logic when you need more control.

Let’s start with the fast solution when you just need to put it in maintenance quickly.

Using the framework’s maintenance feature

For a fast implementation, you can use asp .Net Core’s maintenance feature by adding a file called “app_offline.htm” in the root of your solution. This is a very nice, quick and easy solution that lets you create a HTM(L) file with the layout and message that you want to show to your users you are performing maintenance on the app.

This feature is called the “App offline file”, and has some things to consider, like:

  • the file can be maximally 4Gb in size (should be more than enough)
  • it needs your app to receive another request to become online after removing the file
  • in specific situations, the app might not shut down immediately

You can read Microsoft’s documentation on the App Offline file feature, here:

The App Offline file feature is very nice for small projects, MVP’s or demo setups, and side projects.

If you want more control of how to implement maintenance mode, and want to add logic- or signalling features for a more controlled process, you will need to code your own solution. I will explain this in the following part.



Edwin Klesman

Team lead @Detacom | cross-platform | mobile & web dev | Product Development | SaaS | your guide from app ideas to realization | Owner www.eekayonline.com