Site Archives Visual Studio

T4: Extending the Generated Template Class by Mike Pagel


Mike Pagel recently posted an interesting article about T4 on CodeProject called “T4: Extending the Generated Template Class“. In this article, Mike describes several approaches for implementing code generation logic - helper methods defined in class feature blocks, custom directive processors and a custom TextTransformation base class referenced using the inherits attribute of the template […]

T4 template for generating SQL view from C# enumeration


Database tables often contain columns that store codes, or values with special meaning. In application code, these special values can be encapsulated as enumerations. This article demonstrates how to use T4 code generation templates and Visual Studio CodeModel API to generate SQL views that encapsulate the special values for use in SQL code.

T4 Architecture


This article provides an in-depth look at the architecture of T4 template transformation process, discusses some constraints that limit template design, describes techniques that can be used to work around these limitations and points out some (sometimes undocumented) mechanisms for making your T4 templates more powerful.

Understanding T4: <#@ property #> directive


This article describes the purpose and implementation mechanics of the T4 <#@ property #> directive.

How to generate multiple outputs from single T4 template


For some code generation tasks, like generating SELECT stored procedures based on indexes of a given database table, number of output artifacts may not be known upfront. Because T4 was designed to generate a single output file from one template file, developers are forced to generate multiple code artifacts in the same source file. This conflicts with the widely used practice of using one source file per code artifact. This article demonstrates how to work around this limitation of T4, generate multiple files from a single template and automatically add them to a Visual Studio project.

Code Generation with Visual Studio Templates


This article provides an overview of Visual Studio Templates, demonstrates how to create a project item template for a T4 file and includes a ready-to-use T4 item template.

Visual Studio Templates for T4


Musings about Visual Studio Templates. Includes links to articles about Visual Studio Templates and ready-to-use templates for T4 files.

Understanding T4: <#@ assembly #> directive


This post describes the purpose and implementation mechanics of the T4 <#@ assembly #> directive.

Text Template Transformation Toolkit


This article provides an overview of Text Template Transformation Toolkit (T4) and includes links to additional articles about T4 and ready-to-use templates.

TFS Power Tools


I have been using TFS Power Tools for a while and thought it would be a good idea to mention it now that a new version was released.
Visual Studio 2005 Team Foundation Server Power Tools is a set of enhancements, tools and command-line utilities that improve the Team Foundation Server user experience.

Team Foundation […]