SiberianGuy
SiberianGuy

Reputation: 25292

T4 Include file path from project root

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

Upvotes: 10

Views: 3898

Answers (2)

Rajnikant
Rajnikant

Reputation: 2236

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.

Upvotes: 2

podiluska
podiluska

Reputation: 51494

You should use $(ProjectDir)

<#@ include file="$(ProjectDir)\Infrastructure\Manager.ttinclude" #>

You can also use $(SolutionDir) for the Solution root.

Upvotes: 18

Related Questions