Non-app config (e.g. NLog.config) transformation with SlowCheetah in Console App

As we are in the world that everyone is talking about continuous integration, continuous delivery and etc., the transformation of configuration file for different environments become very important for every developments. Microsoft provides us a way to transforming web.config for every web deployment but they seems forgetting about other types of projects like console application and non web.config files.

People like us have tons of projects that are not web projects or contain other types of configuration files. How do we transform those configuration file? Well, we are lucky that there is an awesome tool called SlowCheatah that can help us to transform all of your xml configuration files on build.

Offical SlowCheatah screenshot

Yes. SlowCheatah is very good tool but we always used to have small problems in transforming non-app config files using this tool. We always have to spend a bit of our time to tweet here and there to make it work.

So, I decided to spend some times on writing this post as a check-list for troubleshooting SlowCheatah .

Check-list for troubleshooting SlowCheetah’s XML transformation

1. SlowCheetah Visual Studio Extension

One of the most common mistakes is that you don’t have SlowCheetah extension installed on your Visual Studio. You can verify whether you have it installed or not in “Extensions and Updates” dialog.

SlowCheatah - Extensions

2. Use “Add Transform” menu instead of adding the file manually and modifying the csproj

If you already have that extension installed, you can see “Add Transform” manu in Solution Explorer when you right click on configuration file. Please use that manu for adding the different setting for new xml configuration.

SlowCheatah - Add Transform

3. Verify SlowCheetah in csproj

If two steps above are not helping you then you can manually check the SlowCheetah setting in your csproj. You need to have “TransformOnBuild” and “IsTransformFile” for your new XML configuration file and SlowCheetab import should be included in your csproj.

SlowCheatah Config in proj

SlowCheatah - in csproj

I hope you find this checklist helpful when you are troubleshooting SlowSheetah issue. Please feel free to let me know if you have any comment or question..

Happy transformation!

Posted in C#

Leave a Reply

Your email address will not be published. Required fields are marked *