I have a quite a bit of T4 runtime templates in my solution and I'd like to organize them in folders, but my builds fail as soon as I do so. The failures are simply because of template can't be found. How can import or add a search path for t4 runtime template in my classes ?
Asked
Active
Viewed 146 times
1 Answers
0
You can specify either absolute paths or relative paths. If the included file resides within the same solution, use relative paths. Example:
<#@ include file="..\..\..\..\EPS\EPS.Framework\EPS.Framework.Common\Localization\ML.ttinclude" #>
Here the included file resides withing another project in the same solution. Use ..\
to move up one folder.

Olivier Jacot-Descombes
- 104,806
- 13
- 138
- 188
-
This is if I wanted to include a template within a template, right ? – user1530181 Dec 05 '13 at 18:01
-
This is if I wanted to include a template within a template, right ? What about when referencing a template name in the code and it isn't in the same folder ? – user1530181 Dec 05 '13 at 18:26
-
See [Run-Time Text Generation with T4 Text Templates](http://msdn.microsoft.com/en-us/library/ee844259.aspx). – Olivier Jacot-Descombes Dec 07 '13 at 16:49