Building Project in VSTS doesn't build all projects in solution

核能气质少年 提交于 2019-12-03 16:17:18

Since you mentioned "WebDeploy", I suspect that you are building a web app project with some other projects in the solution. The behavior you see is usually caused by the default "Visual Studio" build definition template. With the default settings of this template, the "Copy Files" task copy the files in "**\bin\$(BuildConfiguration)**" folder to "$(build.artifactstagingdirectory)" folder and then publish the files in "$(build.artifactstagingdirectory)" folder. But this is not applicable to Web App Project.

To fix this issue, adding following arguments in "MSBuild Arguments" section of "Visual Studio Build" task:

/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:PackageLocation="$(build.artifactstagingdirectory)\\"

Then you will get a deployment package in artifacts and you can deploy it via web deploy.

I also had this issue (or similar?) The artifacts for the main project were not published, only the test project.

When looking in the log file i noticed two things.

  1. Only files from the Test project were copied

  2. The task "Copy Files to:$(build.artifactstagingdirectory)" was looking for contents using the wildcard "\bin\release**" this path is set in the build step "Copy Files" / "Content" and is "\bin\$(BuildConfiguration)**" by default, translating to your setting in "Variables" / "BuildConfiguration" under this build definition.

Then I looked at the project settings in Visual Studio and for some reason the main project had the setting in "Build / Output / Output path" set to "bin\"; changing this to "bin\Release" for Release and "bin\Debug" for debug solved my problem.

Solution?

a. Set VS project setting "Build / Output / Output path" to "bin\Release"

b. (or change VSTS build step "Copy Files" / "Content" to "\bin" to catch everything in bin)

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