I have a project A in Visual Studio where I need some files from project B (to keep a single point of definition). I use these files in project A for Chutzpah to include the dependencies for the tests, for example jQuery. This works by adding jQuery AS LINK from project B to project A.
Now I am trying to build a t4 template to generate the HTML file including some DOM elements, a script and a test script. In the t4 template you can read a file to include:
<#
string root = Host.ResolvePath(string.Empty);
string relativePath = @"..\..\..\..\Scripts\Script files\jquery-1.5.1.min.js";
string jquery = File.ReadAllText(Path.Combine(root, relativePath));
#>
<script src="<#= jquery#>"></script>
This is the path to the folder where jQuery is added as link. Obviously this does not work, because the files aren't really there, only as link in the Visual Studio project.
Is there a way to read the files anyway from the t4 template?