Get Project or Relative Directory with T4

前端 未结 2 1244
北海茫月
北海茫月 2021-01-30 20:51

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

2条回答
  •  盖世英雄少女心
    2021-01-30 21:08

    You can grab the path like this aswell

    <#@ template hostspecific="true" #>
    <#= Path.GetDirectoryName(this.Host.TemplateFile) #>
    

提交回复
热议问题