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

(70) Review
Visual Studio
2012, 2010
Download (68,877)
2/23/2013
2.5.5
View
E-mail Twitter del.icio.us Digg Facebook
Add To Favorites
Description
Reviews (70)
Q and A (162)
Sign in to Write a Review
Sort By:

by Philippe Truche | May 08 2013

Excellent tool. Maybe the next Visual Studio Service Pack will include it so that it becomes an out of the box feature.

by Brad Deem | May 03 2013

by Zahid Iq | April 30 2013

excellent !!
a long awaited extension

by straightener | April 09 2013

We had several self-inflicted wounds with accidentally testing applications that had config entries that pointed to production instead of the quality assurance environment. Because of this we searched and found Slow Cheetah that let us separate the configs into Development, QA, and Production. Things are a lot safer now. Thanks for creating this.

by rovsork | March 19 2013

This just makes life that much easier.
Powerful and simple, and it gives you a feature that feels so natural you would thought it was already there!

by arcainatwork | March 14 2013

This extension is one of the most useful in my toolbox. If MS doesn't roll this functionality into VS, it could be considered a crime.

by Damian Penney | March 06 2013

This works really well - exactly what I was looking for. Thanks guys!

by Daniel Mackay | March 05 2013

Watched the Visual Studio Toolbox video on this some time ago, but have only just installed it. The tool is great and Its saving me heaps of time! No more building and deploying just to diff config files. Thanks for the work on this extension!

by bargz | March 04 2013

This an a most excellent extension. Very helpful to preview and publish configuration transforms for development, test and production environments.

by Caio de Arruda Campos | March 03 2013

Awesome! Exactly what we needed.
Love how it creates files for each publish profile as well as debug/release.

by Jaybirdbsu | February 26 2013

I love the way this works on the build servers!

by Yuri Shpakov | February 16 2013

Hi,

That is a cool stuff. That is to be installed on a develoer computer (VS). But how can I install on build server? Do you have any installation program for that?

Thank you

Sayed-Ibrahim-Hashimi February 17 2013
| Edit |
Delete

Hi Yuri, see my blog post at http://sedodream.com/2012/12/24/SlowCheetahBuildServerSupportUpdated.aspx regarding how to get it working for build servers.

by James Alexander | February 04 2013

Thank you so much for adding support for Azure Worker Roles!

by Erick Mendonça | January 25 2013

It's cool, but does not work for web.config as good as it works for app.config.

Sayed-Ibrahim-Hashimi February 02 2013
| Edit |
Delete

It's on the backlog https://github.com/sayedihashimi/slow-cheetah/issues/39. Should be the next major feature I work on. For web projects this support is much trickier than non-web projects.

by Mike Gledhill | January 09 2013

Excellent. My app.config's are now updated with a Test, PreProd or Prod SQL Server connection string, even when running (rather than Deploying) my apps. A lifesaver - thanks!

by Emilio Gordo | December 07 2012

by rhizohm | December 04 2012

a life saver. thanks guys! great implementation!

by Dave Sexton | November 24 2012

by El Bruno | November 13 2012

Great tool !!!

by Citronas | November 04 2012

Awesome! I'm just so used to web.config transforms in ASP.Net applications that I also want this functionality in a WinForms Application.

Your add-in works like a charm. Keep up the good work. I hope this add-in will be included into VS 2012 sometime in the future, just like they did with Nuget.

Even debug sessions are effected by the transform, depending on the selecte d solution configuration! Really nice work.

Sayed-Ibrahim-Hashimi November 24 2012
| Edit |
Delete

It won't be included in VS2012, and at this time it likely wont ever make it into VS. If you think it should I suggest you make a suggestion at http://visualstudio.uservoice.com/ and have all your friends vote it up.

1 - 20 of 70 Items   
Sign in to Start a Discussion


  • Debug and blank values
    9 Posts | Last Post April 27, 2012
    • I am using SlowCheetah now. In my main web.config for a WCF Service project I wanted to have blank connection strings and blank key names. Then I have transforms setup to replace these with legitmate values depending on the configuration I am in. These seem to work fine when I publish, but when I debug run the application in VS 2010 it does not transform the web.config, and errors out. Is there a way I can get SlowCheetah to implement when I hit F5?
    • For web projects transforms are only kicked in on package/publish.
    • Hello Sayed! Do you know if there is a way to actually make this happen? Does not matter how!
    • I got this working using this gem from Sayed's blog: http://sedodream.com/2010/10/21/ASPNETWebProjectsWebdebugconfigWebreleaseconfig.aspx
    • Is there any way to get the transformation kicked in when i use Web Setup Project?
       
    • yes there is...
      SlowCheetahTargets is very handy to preview transform outputs but the transform feature does not come from it: this is a visual studio task. So you can work with SlowCheetahTargets to edit app.config and derived configuration. 
      Here is how I work with those features:
      1. do not edit web.config : edit only app.config file and it's derived config files (preview results with SlowCheetahTargets)
      2. let's visual studio build the web.config file on pre compile :
      ==> add the lines below to the end of project definition file (.csproj )
        <UsingTask TaskName="TransformXml" AssemblyFile="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.Tasks.dll" />
      
        <Target Name="BeforeCompile" Condition="exists('app.$(Configuration).config')">
          <!-- Generate transformed app config in the intermediate directory -->
          <TransformXml Source="app.config" Destination="$(IntermediateOutputPath)$(TargetFileName).config" Transform="app.$(Configuration).config" />
          <!-- Force build process to use the transformed configuration file from now on. -->
          <ItemGroup>
            <AppConfigWithTargetPath Remove="Web.config" />
            <AppConfigWithTargetPath Include="$(IntermediateOutputPath)$(TargetFileName).config">
              <TargetPath>../Web.config</TargetPath>
            </AppConfigWithTargetPath>
          </ItemGroup>
        </Target>
      
      enjoy...
    • oups, I was not on your question, sorry.
    • @Anders, sorry for the late reply. I have blogged about how to do this at http://sedodream.com/SearchView.aspx?q=transform%20web.config#a68b7e248-b9f5-4d07-bdfe-eb037bcf2cbb.
    • @Thias I have created an issue for this at https://github.com/sayedihashimi/slow-cheetah/issues/3.
  • Non app.config xml files with setup project
    6 Posts | Last Post April 27, 2012
    • Hi,
      I have quite a large app.config file which I've split up using the configSource attribute to get it to point to other xml files with specific bits of configuration in.
      I've used slowcheetah to create transforms on those xml files and it all seems to work well when I do a build but with my setup project only the untransformed xml is installed.
      In my project I've marked the basic xml files build action as 'content' with 'copy to output directory' set to 'Copy always'.  The transforms are set to build action 'none' and 'do not copy'.  The setup project uses get content files to get the xml configs.  
      Is there some other way I should configure the installer so it get's the transformed xml files?
      Thanks,
    • Is there some way to search this Q&A section?  I'm not sure if my question has been answered before and I can't find it.
      Thanks
    • OK, so I found a work around which is a bit ugly but seems to work:
      
      I've created a single file called config.xml in my project and set it to 'Build Action' = 'Content' and 'Copy to Output Directory' = 'Copy always'.
      
      I've also created a file called config.transform.xml which I have 'SlowCheetahed' into transforms which stored the actual configurations I want and their transforms.  This is set to 'Build Action' = 'None' and 'Copy to Output Directory' = 'Do not Copy'.
      
      Then in the project file I've added the following:
      
      <UsingTask TaskName="TransformXml" AssemblyFile="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.Tasks.dll" />
      <Target Name="BeforeBuild">
        <TransformXml Source="config.transform.xml" Destination="config.xml" Transform="config.transform.$(Configuration).xml" />
      </Target>
      
      This then basically overwrites the config.xml file before the build so the correct transform of the file is there.  This seems to then get through to the Setup Project and works for normal builds.
      
      The obvious drawback is that the file gets modified all the time and can cause confusion if developers check in different versions but at least it works.
      
      Hope this helps someone.
    • Oh forgot to say:
      
      SlowCheetah is great.  Being able to check your transforms without doing a build is very helpful!
      
      Cheers,
      
      George
    • Sorry, forgot to mention that you need to get your installer project to install content files as well as build output for the process described above to work.
    • Sorry I think we have a bug here. I have created the following issue to track this https://github.com/sayedihashimi/slow-cheetah/issues/2. Feel free to add comments there.
      
      Regarding the discussion forum here, its not very good sorry.
  • Is there a permission that Slow Cheetah Transform needs on CI server?
    3 Posts | Last Post April 16, 2012
    • Hi Sayed,
      
      I am using this on our dev and our CI server.  The dev machines are using VS2010.  It works fine with both command line and in the IDE with our build script.  However, on the CI server which is Windows 2008 Server and have VS2010, it didn't run TransformAllFiles target in the automated process.  But it works fine from command line running the same build script as an administrator on the CI server.  I have tried to move the dll and the targets files to different locations in build workspace and out in other folders.
      I finally changed our build service to run under a domain user with admin rights instead of local system account.  And it started to work.
      
      So it seemed to me that that target was skipped because either the target file or the dll was not imported.  Is there a specific permission we need to set or is there something else I am missing?
      
      Our build has both web projects and non web projects, the default Transformxml works fine for Web projects with local system account.
      
      BTW, It's a really good tool
      
      Thanks,
    • We are discussing in email, once we resolve it we can update the thread here.
    • +1
  • Transformations and Embedded Resource
    3 Posts | Last Post April 13, 2012
    • Hi Sayed,
      
      I have an xml file as an embedded resource to be used for nhibernate configuration. I would like to embed the transformed file as the embedded resource rather than the original. Since the transformed files are copied in to the relative bin\$(Configuration) the build will and does include the non transformed file as the embedded resource. I was wondering if there is a simple way using "Slow Cheetah" to get the transformed file included as the embedded resource.
      
      One way would be to run the transforms before the build begins and add the xml file as a Link from the bin\$(Configuration) so that you always get the transformed file rather that the original.
      
      --Thanks
    • Hi Kamran, thanks for your feedback. This is not supported but you could always use the TransformXml task directly in your project files to realize such scenarios. 
    • Hello Sayed and Kamran,
      
      I am not at all familiar with msbuild tasks, but I also have the need to transform embedded .resx files and .settings files.  Do either of you have suggestions how to modify the .csproj file to accomplish this?
  • Cannot replace root node
    1 Posts | Last Post April 12, 2012
    • Hi,
      
      I want to add transforms to an EPiServer license file. However, for this to be maintainable I need to replace all content in License.config. When I'm adding xdt:Transform="Replace" to the root node I get the following error:
      
      "Could not write Destination file: Cannot insert the node in the specified location."
      
      This applies to any file except Web.config. Any thoughts on this?
  • Custom transformation dll not supported
    2 Posts | Last Post April 06, 2012
    • Hello,
      
      In our project we use a custom transformation dll by using the following syntax:
      
      <xdt:Import path="C:\Program Files (x86)\MSBuild\Custom\asdasd.Configuration.CustomTransforms.dll"
                    namespace="asdasd.Configuration.CustomTransforms" />
      
      This dll is tested and it worked, however after installing the plugin i'm not able to preview the changes in a transformation which use this dll.
    • Hi Marco, sorry for the late response here. SlowCheetah will likely not work with existing custom transforms. I will add this to the backlog, can you tell me what your transform is doing? I'm just curious.
  • vs2010 console app fails after install
    2 Posts | Last Post April 06, 2012
    • Trying to get started in vs2010 console app but can't get past this compile error:
      
      The "SlowCheetah.Tasks.TransformXml" task failed unexpectedly.
      System.UriFormatException: Invalid URI: The URI is empty.
         at System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind)
         at System.Uri..ctor(String uriString)
         at SlowCheetah.Tasks.TransformXml.Execute()
         at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
         at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask, Boolean& taskResult)
      
      I changed app.debug.config and release.config to content. Not sure which URI it's talking about. Is there some special setup required for console apps?
    • It should work in console apps, are you having this issue with new blank console projects?
  • Transform all configs at once
    2 Posts | Last Post April 06, 2012
    • So work wants to do 1 build with all the config files generated at that time. Can that be done with slow cheetah given about 6 different build defs?
      
    • It can't be done directly with SlowCheetah, but you could modify the .proj file to do that.
  • Add Transform only creates Debug and Release configs for console project
    3 Posts | Last Post April 06, 2012
    • I created a console project. My solution contains 2 other solution configurations (beyond Debug and Release). 
      
      When I selected Add Transform on the app.config all it created was Debug and Release. I would have expected the other 2 as well. I tried setting my config to one of the other configs not generated and tried 'Add Transform' with no luck.
      
      How can I get configs the the other platform configurations generated without manually hacking the .csproj file?
      
      Thanks.
      
      
    • I figured it out. I forgot a step. In Configuration Manager I forgot to create a project configuration for my other 2 setups. Once I did that, the 'Add Transform' worked as I expected and generated the other 2 app.config files. 
      
      Some of the older projects in my solution have those configurations setup. The new console project I forgot to do that.
      
      Thanks.
      
    • Yes that is correct you need to create a project configuration for this to work. Glad you got it worked out.
  • Still relevant?
    3 Posts | Last Post March 23, 2012
    • Does anyone know if Visual Studio 11 will have this functionality available by default? I'm looking at the Visual Studio 11 Beta and I can't see anything... Such a useful tool.
    • This will NOT be baked into VS 11. I tried my best but in the end it didn't make it. I will be updating this addin to work with VS 11 soon.
    • That's a shame... and a surprise too. I really can't foresee what the argument against including it in Visual Studio 11 would be. :-(
91 - 100 of 162 Items