How to get a project's directory from within T4?
- by Earlz
I've been messing around with T4 support in Mono and noticed a very cumbersome thing. The current directory when running T4 templates is the home directory. I need to be able to read a few files from the current project's directory but I'm at a loss for how to.
<#@ template language="C#v3.5" #>
<#@ output extension="txt" #>
<#=System.IO.Directory.GetCurrentDirectory() #>
yields
/home/earlz
where I want it to yield something like
/home/earlz/MyProject
How do I overcome this problem?
Also, I tried the hostspecific and Host.ResolvePath, but I got a NotImplementedException