2

I have a T4 template file that is included in many other T4 templates in different projects and solutions that are on different depth levels of the file system. In the assembly directive I can't use Macros like $(ProjectDir) or $(SolutionDir). I need to use a path relative to the T4 file itself.

How can I do it?

rm5432
  • 327
  • 1
  • 3
  • 10
  • You can create a T4 that probes the absolute paths of the asemblies and that generates another T4 with these paths in the assembly directives. –  Jun 08 '19 at 21:00

1 Answers1

1

You might need to elaborate because $(SolutionDir) works just fine like the following code:

<#@ assembly name="$(SolutionDir)MyFile.dll"#>

It doesn't work from TextTransform.exe though. There are workarounds for TextTransform.exe though with PowerShell.

scottheckel
  • 9,106
  • 1
  • 35
  • 47