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:
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
I can then get the web application from the drop folder under the _PublishedWebsites folder.