azure - 元素 <publishData> 无法识别,或在此上下文中不受支持

标签 azure msdeploy msbuild-task msbuild-4.0

我在本地使用 TFS 2017 来构建我们的代码。我使用了带有以下参数的 msbuild 任务。

/p:DeployOnBuild=true /p:AllowedReferenceRelatedFileExtensions=none /p:PublishProfile="$(Build.SourcesDirectory)\Source\PublishSettings\xxx.azurewebsites.net.publishsettings" /p:VisualStudioVersion=14.0  /p:Configuration=Release

enter image description here

日志:

2017-12-27T07:43:15.6823390Z   Publish Pipeline Deploy phase Stage PipelineCopyAllFilesToOneFolderForMsdeploy
2017-12-27T07:43:15.6823390Z Package:
2017-12-27T07:43:15.6823390Z   Invoking Web Deploy to generate the package with the following settings:
2017-12-27T07:43:15.6979640Z   $(LocalIisVersion) is 0
2017-12-27T07:43:15.6979640Z   $(DestinationIisVersion) is 0
2017-12-27T07:43:15.6979640Z   $(UseIis) is True
2017-12-27T07:43:15.6979640Z   $(IisUrl) is http://localhost:7372/
2017-12-27T07:43:15.6979640Z   $(IncludeIisSettings) is False
2017-12-27T07:43:15.6979640Z   $(_DeploymentUseIis) is False
2017-12-27T07:43:15.6979640Z   $(DestinationUseIis) is False
2017-12-27T07:43:15.6979640Z GetMSDeployInstalledVersionPath:
2017-12-27T07:43:15.6979640Z   $(_DefaultMSDeployMaxVersion) is 3
2017-12-27T07:43:15.6979640Z   $(_MSDeployVersionsToTry) is 9.0
2017-12-27T07:43:15.6979640Z   $(MSDeployPath) is C:\Program Files (x86)\IIS\Microsoft Web Deploy V3\
2017-12-27T07:43:15.6979640Z GenerateMsdeployManifestFiles:
2017-12-27T07:43:15.6979640Z   Generate source manifest file for Web Deploy package/publish ...

我收到以下错误。

The element <publishData> is unrecognized, or not supported in this context

我测试了从 azure 下载的发布设置,它与 Visual Studio 部署完美配合。我的 Web api 项目是 .Net 4.6.1 。

注意:只有这个项目没有正确构建,.Net 4.5.1 的所有其他项目都可以构建,在我们的本地 tfs 代理中完全正常。

最佳答案

publishsettings文件用于生成发布配置文件(右键Project=>Publish=>Import),没有<publishData>发布配置文件中的部分,它位于publishsettings文件中。

因此,通过 VS 生成每个发布设置文件的发布配置文件,并使用它来发布 Web 应用程序。

有一篇关于publish an Azure Web Site from the Command Line的文章.

关于azure - 元素 <publishData> 无法识别,或在此上下文中不受支持,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46337582/

相关文章:

azure - 如何在没有服务主体的情况下访问 Azure REST API?

powershell - 如何找出当前安装的 webdeploy/msdeploy 版本?

MSBuild 使用任务解析引用

.net - 选择要构建的 .Net Framework 的哪个 Service Pack

MSBuild:为主项目生成 XML 文档,但不为依赖项目生成 XML 文档

Azure - 文件的 PGP/GPG 解密

asp.net - 允许冒号(IIS/Azure 中的 :) in URL for ASP. NET Core

msbuild - 来自 TeamCity 的 MSBuild 的/P MSDeploy 参数的完整列表

msdeploy - 如何使用 msdeploy 将包 (zip) 部署到 IIS 下的特定站点

azure - org.postgresql.util.PSQLException : SSL error: Received fatal alert: handshake_failure while writing from Azure Databricks to Azure Postgres Citus