Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Executing a T4 text template in Visual Studio Code

I created a T4 text template (.tt) file in Visual Studio Code, but unlike Visual Studio 2017 (or 2015 ,...) it won't generate the output file after saving the .tt file. How can I generate the output in Visual Studio Code?

like image 624
theGhostN Avatar asked Mar 07 '18 09:03

theGhostN


People also ask

How do I debug a T4 template?

To debug a design-time text template, save the text template file, and then choose Debug T4 Template on the shortcut menu of the file in Solution Explorer. To debug a run-time text template, simply debug the application to which it belongs.


1 Answers

This solution is not exactly what you asked, but it may be useful in many scenarios (on Windows OS only).

You can create a task in Visual Studio Code and run C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\TextTransform.exe. If you don't have Visual Studio you can copy this file to your project folder and execute it from that location.

Any extension that can run a .exe file can do the job.

like image 111
nAviD Avatar answered Sep 27 '22 20:09

nAviD