Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SlowCheetah not producing transformed config file on CI server

I'm using SlowCheetah to transform an XML config file in a Visual Studio web project on a CI server. In Visual Studio 2010 the XML will transform just fine when I publish, but on the CI server no transformation occures. Instead I just get the original non-transformed config file. I followed the instructions provided by Sayed Ibrahim's Blog where he explains to add the SlowCheetah dll and targets file in the solution and point the project file to use those files. I made this change and did a publish in Visual Studio just to make sure it worked and it did. But when I build the project on the CI server I get the same problem I had before.

My assumption is that it has something to do with my MSBuild script that I'm using to build my project on the CI server. Do I need add something to this to tell my project to use SlowCheetah? My build script is as follows:

<Project DefaultTargets="DoPublish"
xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
    <SourceFileRootFolder>$(CCNetWorkingDirectory)\Code</SourceFileRootFolder>
    <WebFolder>DCSIWeb\DCSIWeb</WebFolder>
    <ReleaseFolder>C:\Builds\BuildFolder</ReleaseFolder>
</PropertyGroup>
<PropertyGroup Condition ="$(CCNetWorkingDirectory) == ''">
    <SourceFileRootFolder>C:\Builds\ProjectWorkingDirectory\Code</SourceFileRootFolder>
    <ReleaseFolder>C:\Builds\BuildFolder</ReleaseFolder>
</PropertyGroup>
<Target Name="CleanSource">
    <Message Text="Removing all source files from $(ReleaseFolder)" />
    <RemoveDir Directories="$(ReleaseFolder)" />
</Target>
<Target Name="DoPublish">
    <CallTarget Targets="CleanSource"/>
    <MSBuild Projects="$(SourceFileRootFolder)\DCSIWeb.sln" Targets="Clean;Build" />
    <MSBuild Projects="$(SourceFileRootFolder)\$(WebFolder)\DCSIWeb.csproj"
        Targets="_CopyWebApplication;_BuiltWebOutputGroupOutput;TransformWebConfig"
        Properties="OutDir=$(ReleaseFolder)\" ></MSBuild>
</Target>

The MSBuild script basically builds the project and places the project in to "c:\Builds\BuildFolder". When I look in the build folder after the build has been done I see the .config file I need but no transformation has occurred to it. It's the same file it was before.

like image 206
Scott Andersen Avatar asked Nov 13 '22 06:11

Scott Andersen


1 Answers

Try it with version 2.5.10. Ive modified SlowCheetah to add the .targets file to the project. No extra config required now. More info at https://github.com/sayedihashimi/slow-cheetah/issues/113.

like image 74
Sayed Ibrahim Hashimi Avatar answered Feb 16 '23 00:02

Sayed Ibrahim Hashimi