So what I want to accomplish is transform all config files on the build.
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:
In Solution Explorer, right-click Web. Release. config and click Preview Transform.
Step 1: Install the package "Slow Cheetah" into your solution. Step 2: Right click on the App. config and select the option Add Transform. Step 3: To tweak the appsetting values ,connection strings etc based on the configuration environement.
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>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With