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
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).
Very useful. I like that it looks at the Publish Profiles, although be cautious when you rename a Profile, it does not rename the previously generated transform files. But you can always regenerate and delete the old.
Simply does not work with ClickOnce. I have not found any information that shows how to make XML transformations work with ClickOnce. You can run the transform preview and it looks correct, but the .config.deploy file generated by ClickOnce is the original, untransformed config file. Very frustrating and completely unusable in my situation.
A real must if you wish to deploy to different machine with different configuration settings stored inside some other [filename].config. Still wonder why Microsoft don't have this functionality out of the box.
I spent an afternoon trying to get this going for a team project. After a fair while thrashing with the already-mentioned "The SlowCheetah.Xdt.TransformXml" task could not be loaded from the assembly" problem, I eventually solved it by deleting the %localappdata%\Microsoft\MsBuild\Slowcheetah folder and it semed to resolve itself on my local machine and I was allowed to build and run stuff. I then deployed this to my colleagues who didn't have the plugin, under the impression that the NuGet package would make everything alright. No joy, regardless of what I tried. I'm now having to see if I can hand-roll a solution for changing config settings for people. Gets 2 stars because I like the idea and it kind of worked on my machine.
I have a problem with log4net config files not being updated by SlowCheetah in Visual Studio 2010. I'm using SlowCheetah 22.214.171.124. When I look at diagnostic build output, I receive the message:
Task "SlowCheetah.Xdt.TransformXml" skipped, due to false condition; (Exists('%(RelativeDir)%(Filename).$(Configuration)%(Extension)')
and '%(Link)'!='' ) was evaluated as (Exists('Log4Net.Prod.config')
and '' != '').
I have two questions:
1) Where is SlowCheetah getting the "Prod" configuration from? I'm using the "Release" build profile in Visual Studio 2010.
2) In the csproj file for my project, I see no references to a "<Link>" element but the log4net config file is referenced in a "<None>" element. Clearly Slowcheetah is finding the log4net.config file to attempt the transformation but won't the fact that there is no <Link> element always prevent the transformation from happening?
Is it possible to add custom .targets file with additional TransformXml rules? How do I go on adding my custom transform rules (for example I need the transformed configs to be created in a different directory)? I guess its not good idea to update the SlowCheetah.Transforms.targets file as it is generated and can get overwritten, as says the warning. Or is what I am trying to do achievable without writing a custom rule?
I have VS 2012 u4 with SlowCheetah 2.5.10 and with two VSTO projects (Outlook 2010 Add-in & Word 2010 Template) the transformation work as expected at runtime but not at publish time. I get an error about config “has a different computed hash than specified in manifest” when trying to install the published project and when I look at the config.deploy file it is not the transformed config.
I also done a Windows Forms Application project and everything is working as expected with that project so it let me think that this issue is only affecting VSTO projects.
Really like SlowCheetah, but there is one scenario which I couldn't get working out of the box.
I have a web.config with the following transforms/configurations:
When I publish for Dev, only the Dev transform gets applied and put into the web.config.
This is the standard behavior.
What I actually want to do is build/publish once and deploy on any of the machines.
After publish I want the resulting web.configs to look like this:
Web.Dev.Config (transformed web.config for Dev)
Web.Test.Config (transformed web.config for Test)
Web.Acc.Config (transformed web.config for Acc)
Web.Prd.Config (transformed web.config for Prd)
Is this possible out of the box? Or do I need to change my build scripts manually?
I have a class library project with custom .config files. Build Action for these config files are set to 'Content' and 'Copy Always'. This library project is then referenced in at least 4-5 console applications within the same solution. When the solution is built the class library's assembly and the custom config files are copied on to the the referenced projects bin folder.
What I am trying to do:
Use SlowCheetah to transform custom config files
Though SlowCheetah transforms the config files within the class library project it doesn't copy the transformed file into the referenced projects. i.e it always copies the source/original file.
Found couple of other threads but none of them were solutions based on SlowCheetah, any suggestions would be helpful. Note that I am using Install Shield Limited Edition, so the solution needs to work for .msi/setup files. Also, I dont want to link files and apply transform on the linked files as then I would have to do the same transform on all referenced projects.
I just downloaded the project from github and I'm trying to get it to compile. I've installed Visual Studio SDK and the NuGet packages but I get an error on the reference Microsoft.VisualStudio.ComponentModelHost (version 10.0.0.0). I guess it's because I use VS2012 (and thus VS2012 SDK, version 126.96.36.199). Are you still using VS2010? Is there a way around it so I can still use VS2012 or do I need to go back to VS2010?
I've been using SlowCheetah for quite some time so I suppose I should help out with the development ;)
Finally got it to work. Had to do the following:
Install VS2010 SDK
Install VS2010 SP1
Install VS2010 SDK SP1
Install VS2012 Update 4
Install VS2012 SDK
Open the solution and download the missing Nuget packages.
And you're all set!
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 188.8.131.52'.
Successfully installed 'SlowCheetah 184.108.40.206'.
"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\v220.127.116.11\SlowCheetah.Xdt.dll. Could not load file or assembly 'file:///C:\Windows\system32\config\systemprofile\AppData\Local\Microsoft\MSBuild\SlowCheetah\v18.104.22.168\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 22.214.171.124 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 126.96.36.199 and it still doesn't work. The Preview Transform function shows the correct transform being applied.
Any help would be greatly appreciated.