0

I want to use a cruisecontrol.net like web deploy to transform my base web config file using a debug or release adaptation to transform the config file. I know cruisecontrol.net uses something called nAnt, but am not aware of how to take advantage of existing configuration file transformations like this one inside of cruisecontrol.net. Is there a way to take advantage of these transformations?

Also is there a way to utilize web deploy within cruise control or is that breaking the rules somehow?

RetroCoder
  • 2,597
  • 10
  • 52
  • 81

1 Answers1

1

Cruise Control does not know how to do this, however msbuild can with the inclusion of the web application targets file (Microsoft.Web.Publishing.Tasks.dll); these come with visual studio - maybe WebDeploy too - and achieve the same result as WebDeploy.

You could then write a simple msbuild project (.proj), or a task in your .csproj/.vbproj to invoke the transform.

E.g. (from http://www.diaryofaninja.com/blog/2011/09/14/using-custom-webconfig-transformations-in-msbuild )

<UsingTask TaskName="TransformXml" AssemblyFile="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.Tasks.dll"/>
 <Target Name="TransformWebConfig">
 <TransformXml Source="C:\Code\MyProject\Web.config" Transform="C:\Code\MyProject\TransformFile.config" Destination="C:\Code\MyProject\Web.config" StackTrace="true" />
</Target>
Simon Laing
  • 1,194
  • 7
  • 18