A T4 template is a code-generation language that has been around since VS2005. You should be aware of them, as they are used in areas such as Entity Framework and MVC and can be useful for your own development. To see T4 templates in action, create a file with the extension .tt, add some text content, save the file, and note how Visual Studio will generate a code file from the template. You can apply complex logic using T4 templating language to change the output that is generated depending on various conditions. T4 templates in VS2010 are compiled when they are saved (preprocessed).

This means that they are another type that can be instantiated. Scott Hanselman has some great and information on this area so please refer to the following article:


T4 templates don’t have Intellisense so your best bet is to download the Tangible T4 plugin:


For more see:


Source of Information : Apress Introducing dot NET 4.0 with Visual Studio 2010


Subscribe to Developer Techno ?
Enter your email address:

Delivered by FeedBurner