Chapter 25. Customizing Visual Studio for ASP.NET MVC

 

This chapter covers

  • Creating custom T4 templates
  • Using custom T4 templates
  • Exporting a custom test project template
  • Adding custom test project templates

Tooling within Visual Studio can make building ASP.NET MVC applications faster. Any task that we perform over and over is a candidate for automation and tooling. A computer can perform a task faster and with more accuracy than a human can, especially when the task is performed repeatedly. We’ll look at two quick ways of customizing these tools, specifically the controller, view, and project generators.

25.1. Creating custom T4 templates

T4 (Text Template Transformation Toolkit) is a little-known feature of Visual Studio. It’s a code-generation toolkit, and its templates allow us to customize how files are generated using a familiar syntax. Chapter 21 covered T4MVC, which is a set of T4 extensions provided by the CodePlex Foundation project, MvcContrib.

25.2. Adding a custom test project template to the new project wizard

25.3. Summary