How to turn off dotnet app by using the App Offline file app_offline.htm?

However,  dotnet application is loading .dll/.exe files in an individual process to run the application service, the .dll/.exe file is locked and cannot be replaced or deleted, when the app is running. It is recommended to stop the ASP.NET Core app before updating the files through web deploy,  FTP, HTTP upload or unzip directly from the Control Panel's File Manager.
 
You can create app_offline.htm, this file is used by the ASP.NET Core Module to shut down an app. You can manually create/upload an "app_offline.htm" in the production site's root directory. If a file with the name app_offline.htm is detected in the root directory of an app, the ASP.NET Core Module attempts to gracefully shut down the app and stop processing incoming requests.
 
While the app_offline.htm file is live with your website, the ASP.NET Core Module responds to requests by sending back the contents of the app_offline.htm file. The app_offline.htm file must be less than 4 GB. When the app_offline.htm file is removed, the next request will be started to the application.
 
When using the out-of-process hosting model, the app might not shut down immediately if there's an open connection. For example, a WebSocket connection may delay app shut down. In this case, you need to stop your application manaully by stopping application pool ram from your control panel.
 
 
  • asp.net core, dotne app, offline_htm, core 7, asp.net 4.8
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

How to publish ASP.NET Core from visual studio 2022 as Self-Contained?

Here is instruction how to publish ASP.NET core with self contained (i.e. where all the...

how to create simple webscoket in ASP.NET with SignalR?

1.) Create "ASP.NET Core Web App (C#)" in Visual Studio 2.) Add the SignalR client library In...

How to fix HTTP Error 404 when download static file in ASP.NET core?

You may get an HTTP Error 404 when browsing/downloading a static file like .Apk when the client...

How to Use IdentityServer in ASP.NET Core with Certificate Signing?

Creating and Adding the Certificate To create and add a certificate to your machine's...

Powered by WHMCompleteSolution