Web Deploy 遇到服务器连接问题,不得不终止连接 - Azure App Service

Web Deploy experienced a connection problem with the server and had to terminate the connection - Azure App Service

在尝试从 Visual Studio 将 .NET 5 Web 应用部署到 Azure 应用服务时,我遇到了这个无用的错误 window 消息:

Publish has encountered an error. Build failed. Check the Output window for more details.

A diagnostic log has been written to the following location: "C:\Users\SomeUser\AppData\Local\Temp\tmp6F34.tmp"

输出window有如下错误:

Web Deploy experienced a connection problem with the server and had to terminate the connection. Contact your server administrator if the problem persists. Learn more at: https://go.microsoft.com/fwlink/?LinkId=221672#ERROR_CONNECTION_TERMINATED. Unexpected end of file has occurred. The following elements are not closed: results. Line 1, position 550.

我尝试了 MS 文档页面中概述的所有步骤 here,以及所有其他相关的 SO 答案,但仍然无法完成这项工作。

在发布步骤的大量试验和错误之后,我终于弄明白了。

这是最后一步需要的样子:

基本上,勾选 'Run from package file' 复选框就解决了我的问题。

最后,发布 window 看起来像这样: