How can I get a reference to the directory of the visual studio project or solution or the directory of the t4 template from within a t4 template?
I have a template that
See The Host Specific Parameter section HERE.
This snippet shows how to get the full path of src relative to the template.
<#@ template hostspecific="true" #>
// The location of the src folder relative to the t4 template:
// <#= Host.ResolvePath("src") #>
You can grab the path like this aswell
<#@ template hostspecific="true" #>
<#= Path.GetDirectoryName(this.Host.TemplateFile) #>