App.config transformations with Slow Cheetah causes problems with Windows Azure

I started writing a blog post last week about how I discovered Slow Cheetah and how it made adding transformations to app.config files faster than a fairly slow cheetah!

Before I finished and published the blog post I just happened to publish my latest getTestr code to Azure, using the release transformations on my web.config and app.config files (one for my Azure Web role, and one for my Azure Worker role) that I’d added using Slow Cheetah, and for some reason I kept seeing the Debug version of my config files instead of the Release versions! Although reading this post you’re probably thinking it’s totally obvious what the problem was (a bit like watching an episode of Poirot and at the end going “oh yes now I get it – it’s obvious now that he’s explained it…”) at the time I couldn’t figure out why the the transforms weren’t working. My Azure publishing profile was set up to use the Release Build:

azure-publish-settings

Yet every time I hit the publish button and checked in the csx folder (this is where the Azure Cloud Service component puts the build files before pushing them to the server) I saw this:

azure-build-folder

After lots of head scratching, Googling, deleting and re-creating publishing profiles I stumbled upon a comment somewhere that disabling extensions fixed a similar problem for some dude.

Ah, Hastings – the little grey cells they are now working perhaps!

So the fix to my problem was disabling the Slow Cheetah extension in Visual Studio. Easy when you know the answer…

It’s a bit of a shame because the Slow Cheetah extension seemed pretty cool and I’m sure it will work fine if you’re not publishing to Azure (publishing the solution to a local drive for instance worked absolutely fine). Also I spent a good 30 minutes writing a previous blog about how cool it was before realising it had broken my publishing process – all those words wasted!

However, it’s clearly not the right extension for me and I’ve now uninstalled it. On the plus side, I know a lot more about app.config transforms than I did a week ago!

Posted in Code, Visual Studio, Web development, Windows Azure Tagged with: , , , ,
  • cmatskas

    Thanks buddy, this really helped! I have been freaking out with the web.config not transforming properly when deploying to Azure. I ended up reaping it all apart. Now I know the answer and I thank you.

    • MaffRigby

      Cool glad I could help!

About Maff

Maff Rigby

I'm a certified .Net, Umbraco and AngularJS freelance developer with over 15 years experience in the IT industry. As well as writing code I love to teach; I run a number of workshops and 1-1 coaching sessions on Angular JS and Umbraco, and share what I know and learn here!

I’m social (ish)

Connect with me on LinkedIn, follow me on Twitter, or fail to find me on Facebook.