Can you use global variables inside a t4 template?
How can I use global variables in a TT file? If I declare a variable in the header I get a compile error if I reference it in a function. <#@ template debug="false" hostspecific="false" language="C#" #> <#@ output extension=".cs" #> <# int ValueForThisFile = 35; SomeFunction(); #> <#+ void SomeFunction() { #> public void GeneratedCode() { int value = <#=ValueForThisFile#>; } <#+ } #> I know that I could pass it as an argument but there are hundreds of calls and it would be syntactically tighter if I could avoid that. If this were one file I could hard code the value but there are dozens of