I am using T4 in Visual Studio 2010, and I want to iterate over the files in my solution, however I have found that T4 source generation works in a kind of a sandbox, and the cu
You must set the hostspecific attribute to true like so:
<#@ template language="C#" hostspecific="True" #>
The ITextTemplatingEngineHost interface will give you the information you need.
<#= this.Host.ResolveParameterValue("-", "-", "projects") #>
I don't believe there is a way to reference the solution, but you can get the path in which your *.tt file is and from there get other files.
To load a file from a location relative to the text template, you can use this:
this.Host.ResolvePath("relative/path.txt")