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.