Web Deployment Builds in TFS 2010 - Part 2

by Aaron 29. December 2010 23:00

I've been patting myself on the back for a few days now because of our QA builds.  The next step in creating our automated builds is creating the release builds.

For our release builds, we don't want to automatically deploy the code.  Sounds simple, right?  I thought so too, but I found that the build doesn't apply the web.config transformations.  I accept the challenge!

After a bunch of trial and error, and staring at the targets files "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" and "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.targets", I finally found the answer in the former targets file:

  <!--
 ============================================================
 _CopyWebApplication

 This target will copy the build outputs along with the
 content files into a _PublishedWebsites folder.
 
 This Task is only necessary when $(OutDir) has been redirected
 to a folder other than ~\bin such as is the case with Team Build.
 
  The original _CopyWebApplication is now a Legacy, you can still use it by setting $(UseWPP_CopyWebApplication) to true.
  By default, it now change to use _WPPCopyWebApplication target in Microsoft.Web.Publish.targets.   It allow to leverage the web.config trsnaformation.
 ============================================================
 -->

So, I set the UseWPP_CopyWebApplication to True in the MSBuild arguments.  I then got this error:

C:\Program Files\MSBuild\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.targets (868): These two Properties are not compatable: $(UseWPP_CopyWebApplication) and $(PipelineDependsOnBuild) both are True. Please correct the problem by either set $(Disable_CopyWebApplication) to true or set $(PipelineDependsOnBuild) to false to break the circular build dependency. Detail: $(UseWPP_CopyWebApplication) make the publsih pipeline (WPP) to be Part of the build and $(PipelineDependsOnBuild) make the WPP depend on build thus cause the build circular build dependency.

I took the advice of the error message and set PipelineDependsOnBuild to False.

My MSBuild Arguments for a simple release build that applies the web.config transformations are now

  • /p:UseWPP_CopyWebApplication=True
  • /p:PipelineDependsOnBuild=False

I can then get the web application from the drop folder under the _PublishedWebsites folder.

Tags: , , , ,

Comments

1/3/2011 3:44:27 AM #

Michael Collier

Awesome info!  I've been looking into this area some too.  Big help here!!  Thanks for sharing!

Michael Collier United States

Comments are closed