This project is read-only.

Multiple includes of the same ttinclude

Jun 28, 2012 at 11:13 AM
Edited Jun 28, 2012 at 11:14 AM

main.tt:

 

<#@ include file="T4Toolbox.tt" #>
<#@ include file="ttUtil.ttinclude" #>
<#@ include file="MVCview.ttinclude" #>
...

 

MVCview.ttinclude:

<#@ include file="ttUtil.ttinclude" #>

Case 1. MVCview contains include of ttUtil, T4Editor intellisense works as expected, main.tt compilation says "Error 3 Compiling transformation: The type 'Microsoft.VisualStudio.TextTemplatingD90A15CA89DBA5B3CE089760DBD7D77DDCF1FC36D734EA9F7A26E9D14A1984448B20F0D8E1484BF7C3247C9E9DD723B4C5FCDED6571926E80B6DC5FCD9C0B866.GeneratedTextTransformation' already contains a definition for 'ttUtil' ..."

Case 2. MVCView does not contains include of ttUtil, compile works as expected, intellisense is not working (obvious, T4 doesn't know nothing about main.tt in MVCview.ttinclude)

How to resolve this small issue? Something like require_once in PHP :) ...

Thanks in advance,

Ondra