TFS 2018 Build Console Application doesn't get included in the build artifact

纵然是瞬间 提交于 2021-02-07 08:00:35

问题


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"

回答1:


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, and VisualStudioBuild 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.



来源:https://stackoverflow.com/questions/50468925/tfs-2018-build-console-application-doesnt-get-included-in-the-build-artifact

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!