TFS 2018 构建控制台应用程序未包含在构建工件中

标签 tfs continuous-integration tfsbuild continuous-deployment

我正在设置 持续集成和持续交付 基础设施,我的解决方案包含 Web 项目、dll 和控制台应用程序。
我的问题是我的所有项目都包含在构建工件中,除了控制台应用程序
这是我使用的默认 MSBuild 参数

/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:DesktopBuildPackageLocation="$(build.artifactstagingdirectory)\WebApp.zip" /p:DeployIisAppPath="Default Web Site"

最佳答案

生成 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\1\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任务来构建其余的应用程序。引用这个类似的线程:TFS 2015 CI - Build artifacts are not generating for Console application in the solution which has web, console and WCF projects

更新:

您可以简单地将它们复制到网站。尝试使用 Windows Machine File Copy要做到这一点,您也可以编写自己的脚本来做到这一点。

enter image description here

关于TFS 2018 构建控制台应用程序未包含在构建工件中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50468925/

相关文章:

continuous-integration - 谁能举例说明如何配置 Bamboo 来构建 Xcode 项目?

continuous-integration - 自动化每日构建的最佳方式

tfs - 是否可以重命名TFS标签?

java - 用于 Git 或 TFS 的 Ivy 自定义解析器

TFS 2010 构建定义 : MSBuild Arguments seems to be ignored

visual-studio-2012 - Visual Studio 2012 重定向 Microsoft.TeamFoundation.Client.dll 的绑定(bind)

tfs - 如何使用 REST API 列出 TFS GIT 存储库中的所有文件

tfs - 在 TFS (Team Foundation Server) 中的团队项目中设置文件夹级别权限

continuous-integration - 有人知道托管 TeamCity 构建提供商吗?

visual-studio - 对于 TFS 构建,$(TeamBuildConstants) 为空