Skip to content
This repository has been archived by the owner on Dec 30, 2022. It is now read-only.

Why another template engine

Tobias Zürcher edited this page Aug 17, 2014 · 2 revisions

Why another tool

I don't like web config tranformations from Microsoft for several reasons but I don't want to bash it too much now. I had a lot of pain with it and won't use it anymore. You probably also had troubles with it, that's why you are reading this article now, right? :) This is an opiniated way of how to do config transformations. I'm open for any proposal, questions or critism.

People are still asking me what's so bad about the web conf transformations. Honestly, if you are happy with them, keep them! I'm not here to try to sell you anything. If you feel limited or your web config transforms becomes unmaintainable, Transformer is something for you! My personal dislikes in web config transforms:

  • designed for xml files
  • coupled to xsd (in Visual Studio) which may lead into weird situations
  • the syntax is too verbose & complex (Yes it really is!). The tempate should be much easier to read.
  • it's connected to the "Configuration Manager"
  • while comparing two different config's: there is too much noise
  • weird error messages if something goes wrong

A lot of blogposts show how to add "dev", "test" & "prod" to the config manager and do then the web config transforms (if they are not in the solution configuration, you don't get the "Add config transform menu entry"). Environment configurations shouldn't be connected to the build. The build should be "neutral"

There are other awesome products like OctopusDeploy or the Redgate Deplyoment Manager. They also include a variable resolve mechanism or use Microsofts Web Config Transform. But for me as a developer, those tools are too far away or probably I don't even have access to it. The whole configuartion stuff should be closer to the developer so he can deliver a complete feature with configurations.

  • Environment configuration in source control: versioned, diffable, history
  • Easy reachable by all developers (exception: production may be handled seperatly because of security)

PowerDeploy can easily be integrated in other tools. TODO: Link to article how to integrate