0
votes

Trying to use a hosted build agent and an on-prem release agent.
Project is an ASP.Net MVC web app within a solution with other projects. The build completes successful but there is nothing in the artifact folder so the release does nothing.

[ update 5/22/2018] What I need to do is publish to some location relevant to the hosted agent, then in my on-prem release agent, be able to use a copy_files task to simply copy those files to a unc path.

[ update 5/23/2018]
Using these msbuild arguments on the build task, I was able to get a zipped folder containing the published files. The only problem now is that the files are in a deeply nested structure. So I either just need to unzip them on a release task, or prevent them from being zipped.

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

Build log enter image description here

Build task (Hosted VS 2017 agent). The /t parameter is followed by a project_name. enter image description here

Publish task of Build definition enter image description here

Release definition, with just a copyfiles task (this runs on-prem) enter image description here

1
You redacted a very relevant part of the build task definition: The MSBuild arguments.Daniel Mann
The only msbuild argument in the build task is the /t parameter and its followed by a project_name. That part seems fine. Its the 1st screenshot that shows that the drop artifact is empty. Ive updated the post above.bitshift

1 Answers

2
votes

You need to use the default MSBuild Arguments in Build step since you use ASP.NET build template:

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

Or you need to add a Copy Files task before Publish Build Artifacts to copy the files you need to path $(build.artifactstagingdirectory):

enter image description here