T4 Include file path from project root

前端 未结 2 2396
情话喂你
情话喂你 2021-02-20 18:21

How can I include file relatively to project root? Somthing like <# @include file=\"~/Infrastructure/Manager.ttinclude\" #>

2条回答
  •  北海茫月
    2021-02-20 18:44

    if you want to include file in some shared project then you can use below

    <#@ include file="..\AnotherProjectFolderName\AnotherSubFolder\Shared.ttinclude" #>
    

    First .. will be resolved to current file path So if .tt is under any sub folder of project directory then you can use

    <#@ include file="..\..\AnotherProjectDirectory\AnotherSubFolder\Shared.ttinclude" #>
    

    One ..\ means one folder level up.

提交回复
热议问题