With the T4.FileManager you can define into which files T4 generates your code. You are no longer bound to the default behaviour of T4 that generates all the code of the “example.tt” template into a single “example.cs” file. Now you can split your code into the files you want:
$ dotnet add package T4.FileManager.VisualStudioWith the T4.FileManager you can define into which files T4 generates your code. You are no longer bound to the default behaviour of T4 that generates all the code of the “example.tt” template into a single “example.cs” file. Now you can split your code into the files you want:
Our documentation offers all the details you need to know to work with T4.FileManager.
| Program | Version | Info | File |
|---|---|---|---|
| Visual Studio | 2022 | since Version 3.0 | T4.FileManager.VisualStudio.ttinclude |
| Visual Studio | 2017, 2019 | since Version 3.0 | T4.FileManager.VisualStudio19.ttinclude |
Visual Studio 16.9.x has a bug that prevents you from debugging T4 templates. See this post for an explanation on how to fix it.
Install the nuget package in your project.
Install-Package T4.FileManager.VisualStudio
For more information see documentation.
The execution of the generation remains on the original T4 Text Templates.
There are some user story oriented Reqnroll tests for ensuring that the FileManager is working as expected. Tests for NET Framework are located in the project T4.FileManager.VisualStudio.AcceptanceCriteria and for NET 5+ in T4.FileManager.NetCore.AcceptanceCriteria.
Pull-requests are welcome! Please follow these rules so that we can integrate your pull-requests without much effort:
This project is licensed under the MIT License - see the LICENSE file for details.
See section breaking changes of Change log
Link to old T4.TemplateFileManager: https://github.com/renegadexx/T4.Helper.