Skip to content

Tangible T4 Editor 2.0 Makes Creating T4 Templates Manageable

Updated: at 02:12 PM

Background

Having written way too many code generators in my life, I’ve always been attracted to Microsoft’s T4 generation.  For those who don’t know what T4 is, it’s actually a core technology in Visual Studio (all versions) that has been around for a very long time.  It’s used for lots of things including for example generating the C# code that is compiled into your projects with Entity Framework.

Over the past 5 years, I’ve tried on several occasions to build my own T4 templates and unfortunately have always given up because the building of T4 templates experience in Visual Studio is just not pleasant.

Fast Forward To Tangible’s T4 Editor

http://t4-editor.tangible-engineering.com/T4-Editor-Visual-T4-Editing.html

Because of the huge success of Visual Studio in the market place, there are lots of third party tools available.  The one I’m writing about here is from Tangible and is basically an add on to Visual Studio that let’s you work on T4 Templates in a very friendly manner. It gives you full intellisense around create classes, and most importantly gives you an awesome development experience. For example, as shown in the demo video (screen shot below) you can actually step through running the T4 video and watch your code get generated one line a time.  You of course also watch variables change and everything else you would expect in a Visual Studio debugging session. That alone is worth the cost of admission!

image

There are of course lots of other things the commercial add on to Visual Studio does, but for me, it’s really the T4 editor piece that make it worth the money.

Check out the ORM (Object Relational Mapper) PRISMA. The database access method I use in all my projects