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.
So the T4 and Razor teams got ourselves together in a room and came up with a common way to express how we think about some of these things. Here’s what we came up with:
In short, we have two engines ‘cos they’re optimized for different use cases.
We’ll keep adding individual syntax and features that make sense for those separate use cases, but we’ll try and avoid being different at a conceptual level just for the sake of it.
Thank you, this is a useful and interesting blog post.
I am curious, in theory at least could Razor syntax have been implimented as a T4 template?
Good article, but i want to ask, which one is main stream & support by microsoft dev team?
IMO from the table it looks like Razor and T4 is used for different things.
If you need a general tool for generating code and other text assets ==> T4
If you need a tool optimized for generating HTML content ==> Razor
So my advice would be to ask yourself : What should the tool help you with?
Then pick the tool most valuable to you.
The answer is both are fully supported by Microsoft. Hopefully the article makes i tclear that they are optimized for slightly different purposes.