RdJNL / TextTemplatingCore

T4 Text Templating with .NET 6
Other
57 stars 15 forks source link
csharp dotnet t4 visual-studio visual-studio-2019 visual-studio-2022 visual-studio-extension

# T4 Text Templating with .NET 8 The software in this repository allows you to run a T4 template with the .NET 8 runtime. This means you can load .NET Core and .NET 5/6/7/8 assemblies and use .NET 8 libraries. My team uses it to generate C# code for types in a .NET assembly (using Reflection). We also use it to process a JSON file using .NET's System.Text.Json library.

Author: RdJNL

Latest release

Version 1.3.0 can be downloaded here.

Requirements

How to use it

Visual Studio 2019/2022 extension

TextTransformCore executable

To use the executable, simply run it from the command line. Provide as first and only argument the path to the template file. If the path has spaces in it, makes sure to surround it with double quotes (").

Differences with Visual Studio's .NET Framework T4 processor

There are several limitations to this approach:

This processor has one feature that Visual Studio's processor does not have:

There is one other difference with Visual Studio's processor:

Remarks

How does it work?

The following steps are followed to process the T4 template:

License

The license for all contents of the repository can be found in the LICENSE file.