<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.3.3" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>
<channel>
	<title>Comments on: Understanding T4: &#60;#@ include #&#62; directive</title>
	<link>http://www.olegsych.com/2008/02/t4-include-directive/</link>
	<description>Interfaces are like alcohol - they are a lot of fun when used in moderation.</description>
	<pubDate>Sat, 04 Feb 2012 05:14:49 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.3.3</generator>
		<item>
		<title>By: Luke Horsley</title>
		<link>http://www.olegsych.com/2008/02/t4-include-directive/#comment-3462</link>
		<dc:creator>Luke Horsley</dc:creator>
		<pubDate>Fri, 28 Oct 2011 13:40:55 +0000</pubDate>
		<guid>http://www.olegsych.com/2008/02/t4-include-directive/#comment-3462</guid>
		<description>As per Tom Poulton's comment, nesting relative paths is now supported.

There is however a small issue with the way this is implemented, if you do a lot of template nesting, TextTemplating will append the relative path directories and then place them next to a #line directive in the code it uses to generate the output. The problem with this is that the #line directive has a maximum path length of 260 characters.

If like me you have includes which navigate up directories, this appended path can very quick exceed this length.  For this reason I very much advise using the registry entry, even though this is not ideal with source control.

I wrote a batch script which will point the registry entries to the appropriate directory, dependent upon where the working copy is located.</description>
		<content:encoded><![CDATA[<p>As per Tom Poulton&#8217;s comment, nesting relative paths is now supported.</p>
<p>There is however a small issue with the way this is implemented, if you do a lot of template nesting, TextTemplating will append the relative path directories and then place them next to a #line directive in the code it uses to generate the output. The problem with this is that the #line directive has a maximum path length of 260 characters.</p>
<p>If like me you have includes which navigate up directories, this appended path can very quick exceed this length.  For this reason I very much advise using the registry entry, even though this is not ideal with source control.</p>
<p>I wrote a batch script which will point the registry entries to the appropriate directory, dependent upon where the working copy is located.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tom Poulton</title>
		<link>http://www.olegsych.com/2008/02/t4-include-directive/#comment-3426</link>
		<dc:creator>Tom Poulton</dc:creator>
		<pubDate>Wed, 08 Jun 2011 10:55:35 +0000</pubDate>
		<guid>http://www.olegsych.com/2008/02/t4-include-directive/#comment-3426</guid>
		<description>I've been playing around with T4 templates recently to solve some of our config issues.

In case it helps anyone, the statement "T4 does not support relative path references in nested templates" is now incorrect with the introduction of VS2010 which is very, very nice!!</description>
		<content:encoded><![CDATA[<p>I&#8217;ve been playing around with T4 templates recently to solve some of our config issues.</p>
<p>In case it helps anyone, the statement &#8220;T4 does not support relative path references in nested templates&#8221; is now incorrect with the introduction of VS2010 which is very, very nice!!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Oleg Sych</title>
		<link>http://www.olegsych.com/2008/02/t4-include-directive/#comment-3016</link>
		<dc:creator>Oleg Sych</dc:creator>
		<pubDate>Sun, 25 Apr 2010 15:23:57 +0000</pubDate>
		<guid>http://www.olegsych.com/2008/02/t4-include-directive/#comment-3016</guid>
		<description>No. Include directives are resolved at compile time. This is a scenario that custom directive processors were intended to address.</description>
		<content:encoded><![CDATA[<p>No. Include directives are resolved at compile time. This is a scenario that custom directive processors were intended to address.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: AJ McAlister</title>
		<link>http://www.olegsych.com/2008/02/t4-include-directive/#comment-2970</link>
		<dc:creator>AJ McAlister</dc:creator>
		<pubDate>Tue, 06 Apr 2010 04:17:57 +0000</pubDate>
		<guid>http://www.olegsych.com/2008/02/t4-include-directive/#comment-2970</guid>
		<description>I'm trying to reuse an include file in several projects in one solution. I thought I could be clever and just link the one file to each project so if I made a change it would be seen everywhere.

I can get the location of the include file by scanning the ProjectItems collection and then using get_FileNames(0) but when I try to use a variable name in the include statement it fails.

My short question is: Is there a way to specify a variable file name in the include statement?</description>
		<content:encoded><![CDATA[<p>I&#8217;m trying to reuse an include file in several projects in one solution. I thought I could be clever and just link the one file to each project so if I made a change it would be seen everywhere.</p>
<p>I can get the location of the include file by scanning the ProjectItems collection and then using get_FileNames(0) but when I try to use a variable name in the include statement it fails.</p>
<p>My short question is: Is there a way to specify a variable file name in the include statement?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Prasad</title>
		<link>http://www.olegsych.com/2008/02/t4-include-directive/#comment-2160</link>
		<dc:creator>Prasad</dc:creator>
		<pubDate>Wed, 26 Aug 2009 04:36:21 +0000</pubDate>
		<guid>http://www.olegsych.com/2008/02/t4-include-directive/#comment-2160</guid>
		<description>Hi,
We want tot execute a t4 template file through our custom host. We can execute it if and only the Main.tt file doesnot includes any other .tt file in the include directives.

The Same file we can perform successfully through Visual studio.

Our code for custom host is as below:

            CustomCmdLineHost host = new CustomCmdLineHost();
            Engine engine = new Engine();
            //Transform the text template.
            string output = engine.ProcessTemplate(input, host);

It always gives the error as Loading the include file 'D:\IncludedFile.tt' returned a null or empty string.

As per the MSDN this error comes if the included file is empty, however its not.
http://msdn.microsoft.com/en-us/library/bb126242.aspx

Please suggest.</description>
		<content:encoded><![CDATA[<p>Hi,<br />
We want tot execute a t4 template file through our custom host. We can execute it if and only the Main.tt file doesnot includes any other .tt file in the include directives.</p>
<p>The Same file we can perform successfully through Visual studio.</p>
<p>Our code for custom host is as below:</p>
<p>            CustomCmdLineHost host = new CustomCmdLineHost();<br />
            Engine engine = new Engine();<br />
            //Transform the text template.<br />
            string output = engine.ProcessTemplate(input, host);</p>
<p>It always gives the error as Loading the include file &#8216;D:\IncludedFile.tt&#8217; returned a null or empty string.</p>
<p>As per the MSDN this error comes if the included file is empty, however its not.<br />
<a href="http://msdn.microsoft.com/en-us/library/bb126242.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/bb126242.aspx</a></p>
<p>Please suggest.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Oleg Sych</title>
		<link>http://www.olegsych.com/2008/02/t4-include-directive/#comment-1336</link>
		<dc:creator>Oleg Sych</dc:creator>
		<pubDate>Mon, 25 May 2009 15:06:36 +0000</pubDate>
		<guid>http://www.olegsych.com/2008/02/t4-include-directive/#comment-1336</guid>
		<description>Hugo, I created work item &lt;a href="http://t4toolbox.codeplex.com/WorkItem/View.aspx?WorkItemId=13146" rel="nofollow"&gt;13146&lt;/a&gt; for this problem and can fix it in the next release of T4 Toolbox in a couple of months.</description>
		<content:encoded><![CDATA[<p>Hugo, I created work item <a href="http://t4toolbox.codeplex.com/WorkItem/View.aspx?WorkItemId=13146" rel="nofollow">13146</a> for this problem and can fix it in the next release of T4 Toolbox in a couple of months.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: hugo</title>
		<link>http://www.olegsych.com/2008/02/t4-include-directive/#comment-1335</link>
		<dc:creator>hugo</dc:creator>
		<pubDate>Mon, 25 May 2009 14:50:33 +0000</pubDate>
		<guid>http://www.olegsych.com/2008/02/t4-include-directive/#comment-1335</guid>
		<description>Any new comments on this subject? Is the problem fixed yet?

Kind regards ^_^</description>
		<content:encoded><![CDATA[<p>Any new comments on this subject? Is the problem fixed yet?</p>
<p>Kind regards ^_^</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: hugo</title>
		<link>http://www.olegsych.com/2008/02/t4-include-directive/#comment-1289</link>
		<dc:creator>hugo</dc:creator>
		<pubDate>Mon, 04 May 2009 14:26:27 +0000</pubDate>
		<guid>http://www.olegsych.com/2008/02/t4-include-directive/#comment-1289</guid>
		<description>Cool, thanks !
Could you maybe do me a favor, and email me if the new version is available.

Anyway, Thank you very much for your speedy replies!</description>
		<content:encoded><![CDATA[<p>Cool, thanks !<br />
Could you maybe do me a favor, and email me if the new version is available.</p>
<p>Anyway, Thank you very much for your speedy replies!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Oleg Sych</title>
		<link>http://www.olegsych.com/2008/02/t4-include-directive/#comment-1276</link>
		<dc:creator>Oleg Sych</dc:creator>
		<pubDate>Thu, 30 Apr 2009 10:16:50 +0000</pubDate>
		<guid>http://www.olegsych.com/2008/02/t4-include-directive/#comment-1276</guid>
		<description>It turns out, this is something I overlooked in T4Toolbox. I'll write it up as a bug on CodePlex. Thanks for pointing it out.</description>
		<content:encoded><![CDATA[<p>It turns out, this is something I overlooked in T4Toolbox. I&#8217;ll write it up as a bug on CodePlex. Thanks for pointing it out.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: hugo</title>
		<link>http://www.olegsych.com/2008/02/t4-include-directive/#comment-1275</link>
		<dc:creator>hugo</dc:creator>
		<pubDate>Thu, 30 Apr 2009 06:55:50 +0000</pubDate>
		<guid>http://www.olegsych.com/2008/02/t4-include-directive/#comment-1275</guid>
		<description>Yes ... It does. But for some reason if it's in a folder, it doesn't.</description>
		<content:encoded><![CDATA[<p>Yes &#8230; It does. But for some reason if it&#8217;s in a folder, it doesn&#8217;t.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

