New T4 blog and new T4 samples

Some of you may have noticed that we’ve launched a new T4 official blog over at We wanted a single place to consolidate information about T4, whether it be from my team that produces the core T4 engine or the teams within Microsoft that build on top and use T4 as their code generation…


Hiring again

Folks, if you want to work on Visual Studio, here’s your chance. We’ve two openings for senior developers on my team working on building WPF-based experiences and the underlying infrastructure for agile/enterprise team dev tools. &&   Apply through the jobs site and ping me or just get in touch directly. C’mon, let’s…


T4 vs Razor – what’s the skinny?

You might have noticed in the recent storm of Web Tools releases that there’s a groovy new kid on the template engine block – Razor. A few customers have been asking folks on both teams some questions around this, such as the following. Why do you have two engines? When should I use each of…


Scaffold your ASP.NET MVC 3 project with the MvcScaffolding package and customize with T4

Steve Sanderson has a nice post up about a project he’s working on with the estimable Scott Hanselman. It’s a NuGet package that provides an even easier  on-ramp to development with the just-released ASP.NET MVC3 framework. In their words, it quickly generates a basic outline of your software that you can then edit and customize….


VS2010 SP1: T4 Improvements Summary

Over the last few posts, I’ve talked about the exciting improvements we’ve made to T4 Text Templating in Service Pack 1 for Visual Studio 2010. Here’s a quick roundup: Firstly, T4 no longer locks referenced assemblies in memory, meaning it’s much easier to use reflection in T4 templates and to use compiled helper libraries. Then…


VS2010 SP1: T4 Template Inheritance Part IV – Regular template inheritance

I promised in the last post that I’d show how to do template extensibility and customization using inheritance with regular templates, rather than the preprocessed kind, so here goes. The preprocessed solution was a three-layer design. The base preprocessed template, provided the code generation smarts to spit out a customizable C# class from some…


VS2010 SP1: T4 Template Inheritance Part III – Customizing The Template

Last time, in Part II, I described a highly structured approach to creating and harnessing a preprocessed template to generate a simple C# class from metadata. I put lots of nice extensibility points in that template and now we’re going to exploit them to show how easy it gets to be to customize a template…


VS2010 SP1: T4 Template Inheritance Part II – The Core Template

  Last time, I outlined my scenario – we have a template that produces a very vanilla C# class from metadata and we’d like to customize it to produce something more directly applicable to our current project.  Of course, we could always just copy the standard template into our project and hack around a little…


VS2010 SP1: T4 Template Inheritance Part I – Sample Metadata

We’ve done a bunch of work on T4 in Visual Studio 2010 SP1 to enable template inheritance.  A reasonable question at this point would be “Why would you want inheritance in your text templates?” Well, the typical reason would be the same as with any other code – because you want reuse and extensibility between…


VS2010 SP1: T4 no longer locks assemblies in memory

I’m pleased to say that we made a few nice improvements to our T4 text templating engine in Visual Studio 2010 SP1 (you can find the beta here). Chief among them is resolving an assembly locking issue that more than a few customers have told us has caused them pain. The most typical cases for…