是什么决定了 Visual Studio 中的哪些项目被认为是 Azure Devops Build 中的发布项目

What determines which projects in VisualStudio are consider to be publish artifacts in Azure Devops Build

我有一个包含多个项目 (.NET) 的解决方案。其中大多数是 Web 应用程序和一个控制台应用程序。

我在 Visual Studio 中创建了一个名为 QA 的新解决方案配置。

在我的 Azure DevOps CI Build 上,我已将 BuildConfiguration 设置为 QA。

一切都已构建,但是当我签入我的发布工件时,我没有看到我的控制台应用程序项目工件。

还有其他人遇到这个问题吗?

什么决定了哪些项目可以作为工件发布?

提前致谢

默认情况下,控制台应用程序项目不会发布到工件,因为不需要任何项目特定的设置来生成构建工件目录中的控制台应用程序的 exe 和发布文件。

但是如果你想在工件中包含控制台应用程序,你只需要添加一个复制文件步骤来将控制台应用程序复制到$(build.artifactstagingdirectory)。当然你首先要确定你已经构建了Console Application工程并且.exe文件生成成功。

Build.ArtifactStagingDirectory

The local path on the agent where any artifacts are copied to before being pushed to their destination. For example: c:\agent_work\a.

A typical way to use this folder is to publish your build artifacts with the Copy files and Publish build artifacts steps.

您还可以使用 MSBuild 任务和 VisualStudioBuild 任务分别构建控制台应用程序来构建其余的应用程序。