TFS 2018构建控制台应用程序未包含在构建工件中 [英] TFS 2018 Build Console Application doesn't get included in the build artifact
问题描述
我正在建立持续集成和持续交付基础结构,我的解决方案包含Web项目,dll和控制台应用程序.我的问题是,除控制台应用程序外,我所有的项目都包含在构建工件中这是我使用的默认MSBuild参数
/p:DeployOnBuild = true/p:WebPublishMethod = Package/p:PackageAsSingleFile = true/p:SkipInvalidConfigurations = true/p:DesktopBuildPackageLocation="$(build.artifactstagingdirectory)\WebApp.zip"/p:DeployIisAppPath =默认网站"
不需要任何特定于项目的设置即可生成 exe
并为构建工件目录中的控制台应用程序释放文件.>
但是,如果要在工件中包含控制台应用程序,则只需添加一个 Copy Files 步骤,即可将控制台应用程序复制到 $(build.artifactstagingdirectory)代码>.当然,您首先需要确保已经构建了Console Application项目并成功生成了
.exe
文件.
Build.ArtifactStagingDirectory
之前将任何工件复制到的代理上的本地路径被推到目的地.例如:c:\ agent_work \ 1 \ a.
使用此文件夹的典型方法是发布构建工件与
I am setting up Continuous Integration and Continuous Delivery infrastructure, My solution contains web projects, dlls, and a Console Application. My issue is that all of my projects get included in the build artifact except the console application This is the default MSBuild arguments i use
/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:DesktopBuildPackageLocation="$(build.artifactstagingdirectory)\WebApp.zip" /p:DeployIisAppPath="Default Web Site"
解决方案There is not any project specific setup required to generate the
exe
and release files for the console application in build artifact directory.However if you want to include the Console Application in the artifact, you just need to add a Copy Files step to copy the Console Application to the
$(build.artifactstagingdirectory)
. Of course you need to firstly make sure you have built the Console Application project and the.exe
file generated successfully.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.
Alternately you can build the Console Application separately with
MSBuild
task, andVisualStudioBuild
task to build the rest of the aplications. Reference this similar thread : TFS 2015 CI - Build artifacts are not generating for Console application in the solution which has web, console and WCF projects
UPDATE:
You can simply copy them to web site. Just try using Windows Machine File Copy task to do that, you can also write your own script to do that.
这篇关于TFS 2018构建控制台应用程序未包含在构建工件中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!