gpt4 book ai didi

asp.net - 应用程序 'D:\home\site\wwwroot\' 在检测到 app_offline.htm 后被回收 - ASP.NET

转载 作者:行者123 更新时间:2023-12-03 03:40:19 33 4
gpt4 key购买 nike

我正在开发一个在 Microsoft Azure 上发布的 .NET 项目。当我发布应用程序时,我在日志文件中看到一些终止。特别是,第一个是:

应用程序“D:\home\site\wwwroot\”在检测到 app_offline.htm 后被回收。

我的 Visual Studio 目录中没有 app_offline.htm。所以我正在发布应用程序,它立即终止,因此停止工作。

如何解决这个问题?

最佳答案

请检查 Visual Studio 中的 .csproj,因为它可能包含您正在查找的设置。您可以为 Web 部署 (MSDeploy) 设置的属性之一是 EnableMSDeployAppOffline,它似乎默认为 true

.csproj contents

这会导致创建 app_offline.htm 文件。如果您不想在发布时使应用脱机,请将 EnableMsDeployAppOffline 值设置为 false

此外,取自 Visual Studio publish profiles (.pubxml) for ASP.NET Core app deployment - Compute project items .

When an ASP.NET Core project references Microsoft.NET.Sdk.Web in the project file, an app_offline.htm file is placed at the root of the web app directory. When the file is present, the ASP.NET Core Module gracefully shuts down the app and serves the app_offline.htm file during the deployment.

关于asp.net - 应用程序 'D:\home\site\wwwroot\' 在检测到 app_offline.htm 后被回收 - ASP.NET,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/71478342/

33 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com