MSBuild Syntax for Creating Web Deploy Packages and _Publishedwebsite folder for TFS Builds
_PublishedWebsite folder
Just the _PublishedWebsite folder:
/p:outdir=$(Build.ArtifactStagingDirectory)
Creates a Published Site within the drop location for the build:
/p:outdir=$(Build.ArtifactStagingDirectory)\drop
Or use the Publish Artifact task to copy the contents of the package just created and upload to the drop zone:
Web Deploy Package:
Create Just the Web Deploy Package:
/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:PackageLocation=$(Build.ArtifactStagingDirectory)
Transform Web.config and create Web Deploy Package
/p:DeployOnBuild=True /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:PublishProfile=$(DeploymentConfiguration) /p:TransformConfigFile=true
On Variables tab page DeploymentConfiguration has to be configured. It must be the Name of the publish Profile (filename of the pubxml file). If the file Name is Build.pubxml the publish profile is Build. More Details.
Create Both Published Web Site and Web Deploy Package using MSBuild:
/p:OutDir=$(Build.ArtifactStagingDirectory) /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true
This will create the published website folder with the main site and the Web Deploy package:
Web.config Transform
/p:OutDir=$(Build.ArtifactStagingDirectory) /p:UseWPP_CopyWebApplication=true /p:PipelineDependsOnBuild=false
The /p:DeployOnBuild=true parameter will ensure the Web.config transform is completed
Comments
- Anonymous
January 28, 2019
With a solution containing multiple web apps, if I use "/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:PackageLocation=$(Build.ArtifactStagingDirectory)" I get all the web deploy packages in a single folder. Is there a way to get them all in their own folders?- Anonymous
January 28, 2019
Check out the same question on StackOverflow https://stackoverflow.com/questions/698855/whats-the-best-way-to-get-tfs-to-output-each-project-to-its-own-directory. There might be a solution that meets your needs.
- Anonymous