This package enables you to transform your app.config or any other XML file based on the build configuration. It also adds additional tooling to help you create XML transforms.. Written by: Sayed Ibrahim Hashimi, Chuck England and Bill Hiebert
I've been coding large financial trading frameworks in VS/C# since .NET 1.1 days (12/13 years). From this perspective, I can affirmatively state that Slow Cheetah is by far the most productive package that is not currently integrated into the VS tool. I'm walking through a major rollout now involving five different staging environments and over twenty different server configs. Without Slow Cheetah, the other 35 people in the deployment team waiting on my builds would be left high and dry while I tried to manage the configs by hand. VS management - what the *hell* are you thinking? Integrate!
I really like this tool for Visual Studio (both 2010 and 2013), and cannot understand Microsoft's reluctance to adopt this as a standard feature for all future versions of the IDE.
I found that for me, using the VSIXinstaller for each edition of Visual Studio I'm using, worked well to get it installed. And I have to make sure that custom XML-styled configuration files are marked with "Copy always" or "Copy if newer".
The simple mechanisms for replacing parts of XML that are used by msdeploy on web.config are equally useful with any other config files. SlowCheetah does a great job of extending that functionality in a transparent way to other files.
This extension has saved my countless hours setting up automated builds and continuous deployments. This is a must have if you need to do configuration file transforms during your build and deployment process.
Terrific work -- the only problem with web.config can be solved with a little trickery (http://stackoverflow.com/questions/16225304/using-slowcheetah-config-transforms-on-web-config-in-a-3-5-web-forms-app).
The Jenkins service is running under the Local System account. Can it be that Automatic Package Restore is not correctly installing the SlowCheetah files in the AppData folder? The build is looking for them there, but can't find them:
Project "C:\Tools\Jenkins\jobs\Test1\workspace\Build.msbuild" on node 1 (default targets).
"C:\Tools\Jenkins\jobs\Test1\workspace\.nuget\NuGet.exe" restore "C:\Tools\Jenkins\jobs\Test1\workspace\TestMain.sln"
Installing 'SlowCheetah 220.127.116.11'.
Successfully installed 'SlowCheetah 18.104.22.168'.
"C:\Tools\Jenkins\jobs\Test1\workspace\Applications\TestMvc\TestMvc.csproj" (default target) (11) ->
(TransformAllFiles target) ->
C:\Tools\Jenkins\jobs\Test1\workspace\Applications\TestMvc\Properties\SlowCheetah\SlowCheetah.Transforms.targets(150,5): error MSB4062: The "SlowCheetah.Xdt.TransformXml" task could not be loaded from the assembly C:\Windows\system32\config\systemprofile\AppData\Local\Microsoft\MSBuild\SlowCheetah\v22.214.171.124\SlowCheetah.Xdt.dll. Could not load file or assembly 'file:///C:\Windows\system32\config\systemprofile\AppData\Local\Microsoft\MSBuild\SlowCheetah\v126.96.36.199\SlowCheetah.Xdt.dll' or one of its dependencies. The system cannot find the file specified. Confirm that the <UsingTask> declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask. [C:\Tools\Jenkins\jobs\Test1\workspace\Applications\TestMvc\TestMvc.csproj]
I checked with explorer and there is no AppData folder available under the Local System account.
I've installed the version 2.5.10 and it doesn't work anymore. Please fix or let me download the 188.8.131.52 version.
Error 9 The "SlowCheetah.Xdt.TransformXml" task was not found. Check the following: 1.) The name of the task in the project file is the same as the name of the task class. 2.) The task class is "public" and implements the Microsoft.Build.Framework.ITask interface. 3.) The task is correctly declared with <UsingTask> in the project file, or in the *.tasks files located in the "c:\windows\Microsoft.NET\Framework\v4.0.30319" directory.
Error 42 The "SlowCheetah.Xdt.TransformXml" task could not be loaded from the assembly C:\Users\MYUSER\AppData\Local\Microsoft\MSBuild\SlowCheetah\v2.5.10\SlowCheetah.Xdt.dll. Could not load file or assembly 'file:///C:\Users\MYUSER\AppData\Local\Microsoft\MSBuild\SlowCheetah\v2.5.10\SlowCheetah.Xdt.dll' or one of its dependencies. The system cannot find the file specified. Confirm that the <UsingTask> declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask.
Just some extra info... I found the following folder (it's a x64 system):
But it has no content inside :-(
I have a Web.Debug.config file that logs to a debug log file instead of the release version. In VS 2010, after I upgraded to the extension version 2.5.10, it would no longer transform web.config in debug mode. After I installed the NuGet SlowCheetah package 2.5.5, then would it start working again (installing the latest SlowCheetah NuGet did not work).
After upgrading to VS 2013, even with using SlowCheetah NuGet 2.5.5, it's no longer transforming web.config in debug mode. I also tried NuGet package 184.108.40.206 and it still doesn't work. The Preview Transform function shows the correct transform being applied.
Any help would be greatly appreciated.
We are encountering the following error on many computer, we just downloaded the latest version, and we are trying it on VS2013:
The "SlowCheetah.Xdt.TransformXml" task could not be loaded from the assembly C:\Users\Ahmad\AppData\Local\Microsoft\MSBuild\SlowCheetah\v2.5.10\SlowCheetah.Xdt.dll. Could not load file or assembly 'file:///C:\Users\Ahmad\AppData\Local\Microsoft\MSBuild\SlowCheetah\v2.5.10\SlowCheetah.Xdt.dll' or one of its dependencies. The system cannot find the file specified. Confirm that the <UsingTask> declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask.
We tried to search the path, there is two folders:
C:\Users\Ahmad\AppData\Local\Microsoft\MSBuild\SlowCheetah\v220.127.116.11; this contains the vs extension,
C:\Users\Ahmad\AppData\Local\Microsoft\MSBuild\SlowCheetah\v2.5.10; this contains a copy of my project !!! what is that?
I'm getting the following error message when trying to use SlowCheetah 2.5.10:
Error 45 The "SlowCheetah.Xdt.TransformXml" task could not be loaded from the assembly C:\Users\hrcorval\AppData\Local\Microsoft\MSBuild\SlowCheetah\v2.5.10\SlowCheetah.Xdt.dll. Could not load file or assembly 'file:///C:\Users\hrcorval\AppData\Local\Microsoft\MSBuild\SlowCheetah\v2.5.10\SlowCheetah.Xdt.dll' or one of its dependencies. The system cannot find the file specified. Confirm that the <UsingTask> declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask.TestSuitesUI
This problem was not happening when using version 2.5.5, and it started happening after updating to this version.
Are you using Ncrunch?
If you are you must include the slowcheetah package in Ncrunch.
You didn't have to do this in verison 2.5.5
I'm not using Ncrunch yet, I'm just using NUnit framework. What I did was to install the SlowCheetah package from Visual Studio Gallery, add transforms in the configuration file and compile the solution.
I'm currently using VS Ultimate 2012 with .Net fwk 4.5
I'm new to SlowCheetah and was wondering if someone could provide a simple example for me. I've setup a simple C# app, and I added one setting to the settings called ServerName. In the App.Config file I see:
<setting name="ServerName" serializeAs="String">
I've right clicked on App.config and created the transform files and I see them. I'm having trouble with the syntax of the transform. I've tried several variations, but I think:
<add key="ServerName" value="DevServer" xdt:Transform="Replace" xdt:Locator="Match(key)"/>
<add name="ServerName" xdt:Transform="Replace" xdt:Locator="Match(name)">
Should be correct but it's not working. What am I missing?
Thanks in advance for your help!
Okay, I figured it out:
<setting name="ServerName" serializeAs="String" xdt:Transform="Replace">
works. Is this the best way?
My example above is missing an xdt:Locator and will drive you nuts. here's some example transforms which are working for me:
<!-- We don't want to change the Flow Through setting so nothing special has to be done -->
<!-- To Delete a setting, use the Transform Remove -->
<setting name="DeleteThisSetting" xdt:Transform="Remove" xdt:Locator="Match(name)"/>
<!-- To Change a Setting, use the Transform Replace -->
<setting name="ATweakedSetting" serializeAs="String" xdt:Transform="Replace" xdt:Locator="Match(name)">
<value>This Setting was tweaked in app.debug.config</value>
<!-- To Add a Setting, Use Transform Insert-->
<setting name="AnotherAddedSetting" serializeAs="String" xdt:Transform="Insert">
<value>This Setting was added in app.debug.config.</value>
<!-- if you want to get REAL picky on where it goces, use Insert After -->
<!-- The xpath expression does the heavy lifting -->
<setting name="AnotherAddedSettingPlacedAfterServerName" serializeAs="String"
<value>This Setting was added in app.debug.config.</value>
Basically I'm trying to integrate into build process on TFS and I'm following instructions from a blog post you had. It is not showing the extra project that you are mentioning in the post.
Please see question on StackOverflow.
Is it possible to create transform that doesn't depend on configuration?
I need to make transform for localization purposes.
I have file Data.xml and I need a transform Data.ru-RU.xml which will replace some values in source file and produce output localized file Data.ru-RU.xml
This means that I need original file Data.xml to be included in project as well as translated one Data.ru-RU.xml
Love the product, and have been using it for a while with great success. After an update today though my Azure Worker Role project no longer builds with the following error:
Error 21 The "SlowCheetah.Xdt.TransformXml" task could not be loaded from the assembly C:\Users\idrennan\AppData\Local\Microsoft\MSBuild\SlowCheetah\v2.5.10\SlowCheetah.Xdt.dll. Could not load file or assembly 'file:///C:\Users\idrennan\AppData\Local\Microsoft\MSBuild\SlowCheetah\v2.5.10\SlowCheetah.Xdt.dll' or one of its dependencies. The system cannot find the file specified. Confirm that the <UsingTask> declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask. InternalServices
Could you provide any guidance as to the cause? Also, below is the relevant line(s) in my .proj file that seem to now be causing the issue:
<SlowCheetahTargets Condition=" '$(SlowCheetahTargets)'=='' ">$(LOCALAPPDATA)\Microsoft\MSBuild\SlowCheetah\v1\SlowCheetah.Transforms.targets</SlowCheetahTargets>
<Import Project="$(SlowCheetahTargets)" Condition="Exists('$(SlowCheetahTargets)')" />
This is the error that my colleague was experiencing. I bet if you look in that directory (C:\Users\idrennan\AppData\Local\Microsoft\MSBuild\SlowCheetah\v2.5.10) you'll find a copy of the project files you were building at the time the build failed.
It seems that necessary files are placed at %APPDATA%\..\Local\Microsoft\MSBuild\SlowCheetah\v1. Copy files from the folder to %APPDATA%\..\Local\Microsoft\MSBuild\SlowCheetah\v2.5.10.
List of files:
This solved the problem you stated for me. However, I continue to get following error, for which I have not found any solution:
The "SlowCheetah.Xdt.TransformXml" task was not found. Check the following: 1.) The name of the task in the project file is the same as the name of the task class. 2.) The task class is "public" and implements the Microsoft.Build.Framework.ITask interface. 3.) The task is correctly declared with <UsingTask> in the project file, or in the *.tasks files located in the "C:\Windows\Microsoft.NET\Framework\v4.0.30319" directory.
Hey, if you are running Ncrunch then it's causing the build error.
Install version 18.104.22.168 (important to get that version cause verison 22.214.171.124 and 126.96.36.199 doesn't work) of slowcheetah and include the package in Ncrunch and it will work again. :)
So following Zendu's suggestion worked (this is a clan install computer btw).
I copied the files from the v1 folder to the v2.5.10, restarted VS, and then it seemed to work.
Sayed-Ibrahim-Hashimi - hopefully this gives you enough info to troubleshoot/fix the issue.
Can SlowCheetah transform app.config for WCF projects when published using the file publish method.
I currently have Version 2.5.10 installed and it does not appear to be transforming an publish for my WCF project.
We have multiple target environments (DEV/QA, etc.). Since the only things that change are configuration settings (nothing done with precompilation statements) we'd rather not have to have a configuration per environment; seems like a waste to recompile for each environment since the code is the same. We'd also like to minimize the customization of the SlowCheetah.Transforms.targets file. Is there a recommended way to compile the code once and get SlowCheetah to create transformed config files for multiple environments?
Thanks in advance
No, I haven't. I was hoping to get a reply from Sayed but never did. I know I could do it by customizing the targets file to use a custom variable like $(Environment) instead of $(Configuration) but I was hoping to not customize anything so that I wouldn't have to revisit the targets file to check for possible conflicts.
Overall, I do like SlowCheetah I just really dislike how it and XML Transforms overall are married to build configurations. The binaries for us are not different per environment. The only thing that is different is just the configs. We currently use XML Preprocess and so far, I'm thinking we're going to stick to it.
This is exactly the problem I'm experiencing. I'm trying to overcome the problem by only referencing the SlowCheetah target, but that doesn't work:
MSBuild [path to project file] /t:TransformAllFiles /p:Configuration=Release
I found a pretty decent work around for this, while still using SlowCheetah.
I created some afterbuild events:
<TransformXml Source="web.config" Transform="Web.Staging.config" Destination="webstaging.config" />
<TransformXml Source="web.config" Transform="Web.Release.config" Destination="Webrelease.config" />
With the devops tool we are using (Buildmaster) The files are renamed and replaced on the correct environments.
It's not ideal, but you still have central config files (web.config and umbracoSettings.config), and you only have to manage the changes in the XMLtransform files.