C#中T4模板中获取当前项目或解决方案路径
<#@ template debug="false" hostspecific="true" language="C#" #> <# string solutionsPath = Host.ResolveAssemblyReference("$(SolutionDir)");//获取解决方案路径 string projectPath = Host.ResolveAssemblyReference("$(ProjectDir)");//获取当前项目路径 #> <#=solutionsPath#> <#=projectPath#>