Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

T4 without Visual Studio?

Tags:

.net

t4

I'm trying to wireup some code gen templates to my team's automated build process. Our SCM team doesn't want Visual Studio on our build machine (which I have a hard time arguing with).

Is there a way to install the T4 engine without Visual Studio?

like image 370
kellyb Avatar asked Jun 10 '09 21:06

kellyb


People also ask

What is the purpose of using T4 templates?

Design-time T4 text templates let you generate program code and other files in your Visual Studio project. Typically, you write the templates so that they vary the code that they generate according to data from a model. A model is a file or database that contains key information about your application's requirements.

What is T4 in Entity Framework?

T4 templates in entity framework are used to generate C# or VB entity classes from EDMX files. Visual Studio 2013 or 2012 provides two templates- EntityObject Generator and DBContext Generator for creating C# or VB entity classes. The additional templates are also available for download.


1 Answers

I wrote a cleanly reverse-engineered implementation of a T4 engine for the MonoDevelop IDE. It's open-source, licensed under the permissive MIT/X11 license, so you are free to embed the engine in your app or redistribute it. There's also an implementation of the TextTransform.exe command-line tool available as a dotnet global tool, and some APIs in the Mono.TextTemplating namespace to aid in hosting the engine.

You can get packages from NuGet and the source is on GitHub.

like image 57
Mikayla Hutchinson Avatar answered Sep 19 '22 22:09

Mikayla Hutchinson