SlowCheetah - XML Transforms

Free

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

(125) Review
Visual Studio
2013, 2012, 2010
Download (189,186)
7/20/2014
2.5.11
View
E-mail Twitter del.icio.us Digg Facebook
Add to favorites
Description
Reviews (125)
Q and A (243)
Sign in to write a review
Sort by:

by dittodhole | April 23 2015

by Tim Long | April 20 2015

5 stars, a genuinely useful tool whenever you need different connection strings, diagnostic logging (etc, etc) configuration for release vs. debug builds.

by MSreenath | March 17 2015

Hi Ibrahim,

Thanks for writing this great tool. I have a question regarding this tool.

Question 1:

How this tool will help if I am creating ONE setup project (msi project) for all my environments and have multiple configuration files ? How can I build and deploy in this case.

As far as I can see this tool works great if you are doing file copy deployment. It just does not make sense to create setup file (read msi) for each environment, if that route I am taking for this


Question 2:

I have 5 different applications (Three Console Applications, Two Windows Service and Two Web)

Can I keep a one master config file and update all these five applications without copying same settings to app.staging.confing likewise to all applications.

Again, it takes lot of time and create this tool, I myself struggled create such tool but it is far from the level you have reached.

Please let me know. I am waiting for your response.

Sree

by jhjhkl758 | March 12 2015

ddd

by Cosmin Vana | January 19 2015

by Victor Lindsey | January 16 2015

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".

by 程湘之間 | January 06 2015

It's a very good add-on for Visual Studio.
Maybe making a formal part of Visual Studio will be a good idea.

by Rehan Saeed | December 15 2014

Vote for this feature to be built into Visual Studio. Find out more here:

http://rehansaeed.co.uk/configuration-file-transforms-in-visual-studio-should-be-built-in/

by Omar Gameel Salem | December 08 2014

by Slammer17 | December 02 2014

Recently updated via nuget from :

<package id="SlowCheetah" version="2.5.10.3" targetFramework="net45" />


To



<package id="SlowCheetah" version="2.5.14" targetFramework="net45" />

and after this update, Slow Cheetah stopped transforming files within VS2013 Ultimate Update 4

I rolled back to 2.5.10.3 and it now works fine again.

by Josh Gallagher | October 15 2014

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.

by chris.morgan | September 04 2014

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.

by Gustin G | September 02 2014

Excellent tool - I use it in every project to achieve a clear configuration scenario.

by Thomas TwoAngel Rud Rasmussen | August 20 2014

Doesnt transforms, doesnt add new transforms, doesnt transform web.config as stated.

Soo, that's a no go im my environment

by Toons33 | July 21 2014

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).

THANK YOU SlowCheetah team.

by Victor Pascual Villanueva | July 15 2014

Making things a lot easier for Selenium testing across different browsers:

http://testingisland.wordpress.com/2014/07/10/how-slowcheetah-can-help-with-your-selenium-tests/

by Dmitriy N. Dokshin | July 08 2014

by Frank Fajardo | June 26 2014

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.

by tomKober | June 24 2014

Works like a breeze. :)

by dkehring | June 24 2014

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.

1 - 20 of 125 Items   
Sign in to start a discussion


  • Could not load file or assembly Microsoft.Web.XmlTransform
    1 Posts | Last post November 07, 2014
    • We want to use SlowCheetah on developers computers without SlowCheetah installing. In this case we made following steps:
      - Copy files SlowCheetah.Transforms.targets, SlowCheetah.Xdt.dll, Microsoft.Web.XmlTransform.dll to specified folder in solution
      - Modify the project file: "<SlowCheetahTargets>$(MSBuildProjectDirectory)\..\SlowCheetah\SlowCheetah.Transforms.targets</SlowCheetahTargets>
      "
      - Reload project
      - Uninstall SlowCheetah extension
      
      We have occured following error after rebuild project:
      Error	68	The "SlowCheetah.Xdt.TransformXml" task failed unexpectedly.
      System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Web.XmlTransform, Version=1.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
      
      How to fix it?
  • Could not open Transform File
    1 Posts | Last post October 22, 2014
    • We have a VS2010 solution that we are converting to VS2012. There is one project that is giving us problems. The project is a ClickOnce WPF application that does not have a web.config file (as expected). It has an app.config file with all of the relevant target transformation files already. When we try to build the project then we get the following error:
      
      Could not open Transform file: Could not find file 'C:\Develop\Source\Rnd\FleetView\Development\FleetView\FleetView\Web.Development.config'.
      
      Any suggestions?  TIA!
      
  • support for Azure package for web roles
    1 Posts | Last post October 08, 2014
    • is there support for Azure web role package. I have a custom xml which needs to change based on build configuration. When i build the solution correct xml transformation happens. But and when i create a package for azure web role the transformation does not happen does SlowCheetah support azure web role package?
  • Build error caused by SlowCheetah v2.5.10
    6 Posts | Last post October 06, 2014
    • I am getting the following build error
      
      Error 28 Could not copy "bin\Debug\app.config" to "C:\Users\ara\AppData\Local\Microsoft\MSBuild\SlowCheetah\v2.5.10\bin\Debug\app.config". Exceeded retry count of 10. Failed.
      
      If I delete all files (except 2 files) in 
      
      C:\Users\ara\AppData\Local\Microsoft\MSBuild\SlowCheetah\v2.5.10
      
      then I can build the project. However, after that I cannot build another project in the same solution
      
      Error 17 Could not copy the file "bin\Debug" to the destination file "C:\Users\ara\AppData\Local\Microsoft\MSBuild\SlowCheetah\v2.5.10\bin\Debug", because the destination is a folder instead of a file. To copy the source file into a folder, consider using the DestinationFolder parameter instead of DestinationFiles.
      
      Why is this happening? It seems like the SlowCheetah is trying to write the projects output to the same directory.
      
    • Can you upgrade the SlowCheetah NuGet package to 2.5.10.3? That should fix things.
    • I updated, but the transformation is not working anymore. The option "Show transform" is not shown.
    • I don't know if this is relevant, when I run install-package SlowCheetah I get the following:
      
      PM> install-package SlowCheetah
      'SlowCheetah 2.5.10.3' already installed.
      [ProjectName] already has a reference to 'SlowCheetah 2.5.10.3'.
      Failed to generate binding redirects for '[ProjectName]'. 'Microsoft.Tools.WindowsInstallerXml.VisualStudio.WixProjectNode' does not contain a definition for 'References'
    • Great tool! One problem though: When you try to transform a root-element Visual Studio tells me: Could not write Destination file: Object reference not set to an instance of an object.
      
      I'm using VS2012 Update 3 and SlowCheetah 2.5.10.3 (NuGet package). An example of my config file (Invoice.Debug.config):
      <?xml version="1.0" encoding="utf-8" ?>
      <InvoicePaymentService xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform" cancelUrl="http://mysite.nl/winkelen/geannuleerd/" returnUrl="http://onderwijsadvies.preview.gengu.nl/winkelen/bedankt/" debug="False" testMode="True" xdt:Transform="Replace">
      </InvoicePaymentService>
      
      I've tested it with multiple config files and settings. Re-created the transforms etc...
    • @W. Paap: 
      When doing a xdt:Transform="Replace" on the root element I get the error "Could not write Destination file: Object reference not set to an instance of an object." too.
      
      When I changed to a xdt:Transform="SetAttributes(...)" I got it to work on the root element too.
      
      Note: I only needed to change the attributes of one element.
      
      Note to editors here: Change my syntax if replying to another user is made in another way.
  • Problem with files copying to 2.5.10 directory
    6 Posts | Last post October 06, 2014
    • Not sure if the installer got botched, but after upgrading to 2.5.10 from 2.5.9.1, our test machine began to copy files into a C:\Users\user.x.name\AppData\Local\Microsoft\MSBuild\SlowCheetah\v2.5.10 directory.  The files it copied were the project files that were being built. I was able to work around the issue by defining the SlowCheetahToolsPath in the SlowCheetah.Transforms.targets file to define the tool path.  Is there something I can do so I don't have to hack the targets file manually in order to get SC to work?
    • Can you try after a VS restart and let me know if you still have issues?
    • After both a VS restart and machine restart, SC is still creating a v2.5.10 directory next to the v1 directory in the user profile\local\microsoft\msbuild\slowcheetah directory.  The contents of the directory seem to be all of the project files for any project that contains transforms. They get copied over each other as a project with a transform is processed.  When I uninstall and reinstall SC, the problem persists.
    • I worked around this problem with a conditional Using in my SC tarets file.  Stick these two lines in @ line 36 in your C:\Users\<you>\AppData\Local\Microsoft\MSBuild\SlowCheetah\v1\SlowCheetah.Transforms.targets file.  The 2nd using will use the correct v1 location.
      
        <UsingTask TaskName="SlowCheetah.Xdt.TransformXml" AssemblyFile="$(sc-MSBuildLibPathLocal)SlowCheetah.Xdt.dll" Condition="Exists('$(sc-MSBuildLibPathLocal)SlowCheetah.Xdt.dll')"/>
        <UsingTask TaskName="SlowCheetah.Xdt.TransformXml" AssemblyFile="SlowCheetah.Xdt.dll" Condition="Exists('SlowCheetah.Xdt.dll')"/>
    • The second UsingTask solved my problem too. Thanks
    • @W. Paap: 
      When doing a xdt:Transform="Replace" on the root element I get the error "Could not write Destination file: Object reference not set to an instance of an object." too.
      
      When I changed to a xdt:Transform="SetAttributes(...)" I got it to work on the root element too.
      
      Note: I only needed to change the attributes of one element.
      
      Note to editors here: Change my syntax if replying to another user is made in another way.
      
  • PropertyGroup location in the project file might break the transformation !!
    2 Posts | Last post September 19, 2014
    • After hours of debugging trying to understand why SlowCheetah stopped working after updating to the last Nuget package I discovered that if the "SlowCheetah" PropertyGroup is at the end of the csproj file, file transformation stops working.
      If I move it to the top, it works.
      
      It stopped working because when I updated the Nuget package, the PropertyGroup has been removed from the csproj file and added back, but at the end.
      
      After more research, it seems that the "SlowCheetah" PropertyGroup must be before the following import (the reason being obvious when you know it ^^) :
      <Import Project="$(SlowCheetahTargets)" Condition="Exists('$(SlowCheetahTargets)')" Label="SlowCheetah" />
      
      Could you do something about that ?
      It's a quite hard issue to identify and a simple package update might break SlowCheetah...
    • Thank you julienN!!! You saved my day. At first I thought that the problem is in the build server, but no, actually it's the problem inside Slow Cheetah. I think it should be fixed ASAP, it's too dangerous to use such tool in production...
  • Rename transformation file
    1 Posts | Last post September 02, 2014
    • Hi,
      I added a transformation file  from right click context menu of my Connections.config file subsequent to previous additions done a few months ago.
      The file added is labeled 'Connections.Profile1.config'.  Right click on the file, but there is no option to rename the file. How do I rename the file to Connections.QA2.config.
      Thanks,
  • Transformed files from class library project not copied to the referenced projects
    2 Posts | Last post August 08, 2014
    • Scenario:
      
      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
      
      Problem:
      
      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.
      
      Thanks
    • Given ClassLibararyA references ClassLibraryB:
      
      * Ensure configs from both class libraries are named App.config
      * Configure transformations for both App.configs using SlowCheetah (even if you only care about one)
      * Build
      
      In the output folder for ClassLibraryA, you will find ClassLibraryB.dll.config (the transformed App.config of ClassLibraryB).
  • xdt:Locator example
    2 Posts | Last post July 01, 2014
    • Hi Sayed,
      
      I'm using slow cheetah to manage a custom XML file.  The elements that I want to update/replace don't have an attribute assigned for me to be able to use the xdt:Locator="Match(Attribute)" type of syntax.  
      
      Can you point me to an example/sample of xdt:Locator that does not use the Match syntax?  I've tried using Xpath statements but not having any luck - maybe I'm doing something wrong?
    • Clarification to my question above, if my XML file is formatted as below:
      
      <?xml version="1.0" encoding="utf-8" ?>
      <Configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform" xmlns="http://tempuri.org/Configuration.xsd">
      
      
      
        <!--Sample Service1
        *************************************************************-->
        <ConfigSection Service="Service1">
          <ConfigPoint>
            <ConfigName>ConnectionString</ConfigName>
            <ConfigValue>##ConnectionVariable1</ConfigValue>
          </ConfigPoint>
          <ConfigPoint>
            <ConfigName>OutputFilePath</ConfigName>
            <ConfigValue>HardCodedValue</ConfigValue>
          </ConfigPoint>
        </ConfigSection>
      
      
      
        <!--Sample Service2
        *************************************************************-->
        <ConfigSection Service="Service2">
          <ConfigPoint>
            <ConfigName>ConnectionString</ConfigName>
            <ConfigDescription/>
            <ConfigValue>##ConnectionVariable1</ConfigValue>
          </ConfigPoint>
        </ConfigSection>
      
      
      
        <!--Sample Service3
        *************************************************************-->
        <ConfigSection Service="Service3">
          <ConfigPoint>
            <ConfigName>ConnectionString</ConfigName>
            <ConfigDescription/>
            <ConfigValue>##ConnectionVariable2</ConfigValue>
          </ConfigPoint>
          <ConfigPoint>
            <ConfigName>AuthenticationGroup</ConfigName>
            <ConfigValue>##AuthenticationVariable1</ConfigValue>
          </ConfigPoint>
        </ConfigSection>
        
      </Configuration>
      
      I would like to use Xpath locator to find all instances where ConfigValue = ##ConnectionVariable1 and replace with a new value in the transform.  I'm having difficulty with how to leverage the locator syntax to accomplish this.
      
      Thanks!
  • Failing Team Foundation build with v2.5.10.6
    3 Posts | Last post June 12, 2014
    • Hi I've been using SlowCheetah for over a year.  Awesome, thanks!
      
      However I've run into an issue I need help with please. Apologies it's not a one line question...
      
      The scenario is that in a solution which uses the "old" NuGet package restore (NuGet.exe and targets file checked into source control, no packages checked in), SlowCheetah v2.5.10.6 does not work on my Team Foundation Build server.  This is the actual error I get on the build server:
      
      C:\Builds\11\PaulSlowCheetahTest25105\Properties\SlowCheetah\SlowCheetah.Transforms.targets (153): The "TransformXml" task could not be loaded from the assembly C:\Builds\11\PaulSlowCheetahTest25105\Properties\SlowCheetah\SlowCheetah.Xdt.dll. Could not load file or assembly 'file:///C:\Builds\11\PaulSlowCheetahTest25105\Properties\SlowCheetah\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.
      
      The \Poperties\SlowCheetah dir of course just has the targets file inside.
      
      I have another solution using v2.5.10.3 with NuGet package restore and that is fine. It seems a recent change since 10.3 has introduced this issue.
      
      I searched the web and found this:
      
      https://github.com/sayedihashimi/slow-cheetah/issues/116
      
      At then end of the comments lucusc says: "What fixed it for me was to change how Nuget was restoring packages from the old way (right click solution and click Enable Nuget Package Restore) to the new preferred way. See the 2 links below for more details."
      
      However, using Automatic Package Restore poses other issues for me as my build workflow is customised from an earlier TFS version so I can't use the new TFS2013 build workflow which has Package Restore built in.
      
      Can you suggest a way forward? 
      
      
      
      
      
    • I see a few possible options at the moment:
      
      1. Stick with the "old" NuGet package restore, and install older SlowCheetah v2.5.10.3 which does work OK on my build server.
      
      2. Move to Automatic Package Restore, with latest SlowCheetah, but use this workaround to force the Package Restore to happen before the solution is built: http://blogs.msdn.com/b/dotnet/archive/2013/08/27/nuget-package-restore-with-team-foundation-build.aspx
      
      3. Move to Automatic Package Restore, with latest SlowCheetah, and modify my Team Build workflow to run the NuGet Package Restore before doing the solution build.
      
      None of these options are particularly attractive to me.  I guess 3 is the right way to go but I don't relish the idea of tinkering with the TFS build workflow.
      
      I'd be keen to hear your thoughts!!
    • FYI I went with option 3 in the end.  So updated my build workflow to do a NuGet restore before the MSBuild.  When I looked into it I found a "NuGetRestore" workflow activity so it was pretty simple to achieve.  I hope this helps somebody else!
11 - 20 of 243 Items