9

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

2 Answers 2

7

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>
2
  • Are you sure there are no consequences in doing that? There must be a reason why that condition is there in the first place.
    – Sudeep
    Feb 27, 2014 at 0:07
  • 2
    The condition is there so that it only happens on publish. But we don't use publish. We have custom Wix installers. Feb 27, 2014 at 7:38
-2

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

1
  • 2
    I'm afraid it works only for web.config. For app.config you still need slowcheetah Apr 29, 2016 at 13:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.