Question

So what I want to accomplish is transform all config files on the build.

  • Web.config
  • App.config
  • ....config.xml

In the project files they all look like this:

<None Include="FooBar.config.xml">
  <TransformOnBuild>true</TransformOnBuild>
</None>
<None Include="FooBar.config.Release.xml">
  <DependentUpon>FooBar.config.xml</DependentUpon>
  <IsTransformFile>True</IsTransformFile>
</None>

And everything works fine for windows services and windows applications. But for web projects slow cheetah is not doing the transforms. After some research I found this : "For web projects the files are transformed when you publish or package your application." From the slow cheetah extension page. And indeed when I publish the web project the transforms are done correctly.

So how can I change slow cheetah default behavior and execute all transforms on the build server?

Environment:

  • TFS 2010
  • Slow cheetah version on build server: 1.0.10727.0
Was it helpful?

Solution

So how I fixed this. I've edited the targets file of SlowCheetah

This can be found C:\Users\BuildUser\AppData\Local\Microsoft\MSBuild\SlowCheetah\v1 On your build server. Open the file and locate the following lines:

<BuildDependsOn Condition=" '$(IsWap)'!='true' ">
    <BuildDependsOn> 
      $(BuildDependsOn);
      TransformAllFiles
    </BuildDependsOn>

And i've removed the condition.

Result:

<BuildDependsOn> 
  $(BuildDependsOn);
  TransformAllFiles
</BuildDependsOn>

OTHER TIPS

There is a better solution these days. Just use the transformxml msbuild task. I don't think slow cheetah will continue to be maintained now that this functionality is native to msbuild. More at https://msdn.microsoft.com/en-us/library/dd465326(v=vs.110).aspx

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top