Site Archives Code Generation

T4 Tutorial: Making code generators extensible


This post is a part of the series that introduces code generation with Text Templates (also known as T4 Templates) in Visual Studio using C# and Visual Basic; explains how to create reusable templates and combine them in complex code generators.

T4 Toolbox: LINQ to SQL classes generator


This article describes a new, ready-to-use code generator included in T4 Toolbox, which produces LINQ to SQL DataContext and entity classes.

Pros and Cons of T4 in Visual Studio 2008


This article provides detailed analysis of pros and cons of T4 from the standpoint of an application developer.

T4 Toolbox: Strongly-typed AzMan wrapper generator


Build 8.12.27.1 of T4 Toolbox includes a new project item template for an AzMan authorization policy XML file and a code generator that produces a C# wrapper for performing operation-based authorization checks against it. The generator creates a separate enumerated type with security operations for each application application in the AzMan policy and a wrapper class with strongly-typed Authorize and CanPerform methods that take these enums as parameters.

What is in T4 Toolbox?


T4 Toolbox provides a micro-framework for composite code generators, automatic management of multiple output files in the solution, unit test runner, custom directive processors, ready-to-use code generators and Visual Studio project item templates.

Why use T4 Toolbox?


This article describes why you may want to consider using T4 Toolbox in addition to the Text Template Transformation Toolkit (T4) itself.

T4 Tutorial: Unit testing code generators


This post is a part of the series that introduces code generation with Text Templates (also known as T4 Templates) in Visual Studio using C# and Visual Basic; explains how to create reusable templates and combine them in complex code generators.

T4 Tutorial: Handling Errors in Code Generators


This post is a part of the series that introduces code generation with Text Templates (also known as T4 Templates) in Visual Studio using C# and Visual Basic; explains how to create reusable templates and combine them in complex code generators.

Advanced Code Generation Patterns with T4 & DSL Tools


Back in September, I had a chance to co-present Advanced code generation patterns with T4 & DSL Tools with Gareth Jones and Jean-Marc Prieur at the VSX Developer Conference. Here is the abstract of this session:
Code generation is an increasingly common technique in application development and forms a part of many Visual Studio extensions. With […]

T4 Tutorial: Reusing code generators on multiple projects


This post is a part of the series that introduces code generation with Text Templates (also known as T4 Templates) in Visual Studio using C# and Visual Basic; explains how to create reusable templates and combine them in complex code generators.