MSBuild Syntax for Creating Web Deploy Packages and _Publishedwebsite folder for TFS Builds

_PublishedWebsite folder

Just the _PublishedWebsite folder:


Creates a Published Site within the drop location for the build:


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