0

After a build process in TFS 2017, the publish folder was not created with the zip file. When I review the BuildFolder on the build agent, I can see that a publish folder was created with the name "a_PublishedWebSites", even though without .zip file. I hope that the compilation process creates the Publish folder named "_PublishedWebSites" with the zip file; I mean the packaging in order to execute the publish.

TFS Version: 2017 U3 Solution Version VS 2017 framework 4.6.1

I appreciate any help you can give me about it.

Best Regards

Audberto.

Audberto
  • 11
  • 3
  • Do you use publish option in build step? like: /p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:PackageLocation="$(Build.StagingDirectory)\\" https://stackoverflow.com/questions/35351695/build-and-deploy-a-web-application-with-tfs-2015-build – Shamrai Aleksander Feb 12 '19 at 09:28
  • Hi Aleksander. Thanks a lot for your attention. Yes. MsbuildArgumentes are; /p:CreatePackageOnPublish=true /p:DeployOnBuild=true /p:outdir=$(Build.ArtifactStagingDirectory). When build ends I can see that there are five folder created: 'a', 'a_PublishedWebsites', 'b', 's' and Testresults. I don't know why the folder 'a_PublishedWebsites' is created. ¿Do you know if any variable in the solution define that name? or causes that the build process create the publish on that folder? Thanks – Audberto Feb 12 '19 at 12:32
  • I copy your args and have next folders in $(Build.ArtifactStagingDirectory) and in drop: _PublishedWebsites; _PublishedWebsites\MyWebApp; _PublishedWebsites\MyWebApp_Package. _PublishedWebsites\MyWebApp_Package contains the zip file. – Shamrai Aleksander Feb 12 '19 at 14:32
  • Hi Aleksander. Do you know if there are a variable, as a part of the solution, that may affect or causes that the publish package could no be generated? As I said before whe I review in the build agent I see a folder that contains artifacts with the publish (a_PublishedWebsites), but outside of the build folder. Thnks a lot for your attention. – Audberto Feb 13 '19 at 14:26

2 Answers2

0

I have found 2 problems similar to your question:

  1. The _PublishedWebsite folder is missing in 2015.

Well it turns out if I use the MSBuild argument /p:OutDir=$(build.stagingDirectory)\ {note the explicit trailing slash} then it will force a backslash between the 'a' directory and the '_PublishedWesites' folder. While this works, it seems like I probably have a configuration issue somewhere else necessitating this adjustment to the default build.StagingDirectory value.

So try to use out dir with: /p:outdir=$(Build.ArtifactStagingDirectory)\

and my example includes it: /p:PackageLocation="$(Build.StagingDirectory)\\"

  1. When run from TFS Build (MSBuild or Visual Studio task), path for _PublishedWebsites is generated incorrectly

Maybe you need to update your VS on the build agent.

Shamrai Aleksander
  • 13,096
  • 3
  • 24
  • 31
0

For me, lack of *.dll caused this problem. Reinstall MS-Build via visual studio installer solve it.

Song
  • 593
  • 9
  • 21