<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Multiple outputs from T4 made easy &#8211; revisited</title>
	<atom:link href="http://damieng.com/blog/2009/11/06/multiple-outputs-from-t4-made-easy-revisited/feed" rel="self" type="application/rss+xml" />
	<link>http://damieng.com/blog/2009/11/06/multiple-outputs-from-t4-made-easy-revisited?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=multiple-outputs-from-t4-made-easy-revisited</link>
	<description>A .NET developer in silicon valley</description>
	<lastBuildDate>Wed, 11 Apr 2012 18:41:57 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
	<item>
		<title>By: Versioning with T4 templates &#124; somewhat abstract</title>
		<link>http://damieng.com/blog/2009/11/06/multiple-outputs-from-t4-made-easy-revisited#comment-47782</link>
		<dc:creator>Versioning with T4 templates &#124; somewhat abstract</dc:creator>
		<pubDate>Sat, 10 Mar 2012 22:24:57 +0000</pubDate>
		<guid isPermaLink="false">http://damieng.com/?p=1457#comment-47782</guid>
		<description>[...] of different types in a single file might be a tad unmanageable in some circumstances, I discovered a rather handy T4 mix-in that permits me to output multiple files from a single template using a simple [...]</description>
		<content:encoded><![CDATA[<p>[...] of different types in a single file might be a tad unmanageable in some circumstances, I discovered a rather handy T4 mix-in that permits me to output multiple files from a single template using a simple [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bill Huth</title>
		<link>http://damieng.com/blog/2009/11/06/multiple-outputs-from-t4-made-easy-revisited#comment-46859</link>
		<dc:creator>Bill Huth</dc:creator>
		<pubDate>Thu, 03 Nov 2011 23:40:28 +0000</pubDate>
		<guid isPermaLink="false">http://damieng.com/?p=1457#comment-46859</guid>
		<description>Just an FYI,

If the T4Toolbox is included ( ), the Manager produces no files.  I think it is in the dispose method of the surrounding class...but I could not track it down.

Bill</description>
		<content:encoded><![CDATA[<p>Just an FYI,</p>
<p>If the T4Toolbox is included ( ), the Manager produces no files.  I think it is in the dispose method of the surrounding class&#8230;but I could not track it down.</p>
<p>Bill</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Damien Guard</title>
		<link>http://damieng.com/blog/2009/11/06/multiple-outputs-from-t4-made-easy-revisited#comment-46394</link>
		<dc:creator>Damien Guard</dc:creator>
		<pubDate>Thu, 08 Sep 2011 13:51:51 +0000</pubDate>
		<guid isPermaLink="false">http://damieng.com/?p=1457#comment-46394</guid>
		<description>There&#039;s nothing the template can do automatically as far as I know but you can manually edit the .csproj file and make one &lt;a href=&quot;http://mikehadlow.blogspot.com/2006/11/nested-files-with-dependentupon-in.html&quot; rel=&quot;nofollow&quot;&gt;DependentUpon&lt;/a&gt; the other which will visually stack them in the Project Explorer.

[)amien</description>
		<content:encoded><![CDATA[<p>There&#8217;s nothing the template can do automatically as far as I know but you can manually edit the .csproj file and make one <a href="http://mikehadlow.blogspot.com/2006/11/nested-files-with-dependentupon-in.html" rel="nofollow">DependentUpon</a> the other which will visually stack them in the Project Explorer.</p>
<p>[)amien</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Paul</title>
		<link>http://damieng.com/blog/2009/11/06/multiple-outputs-from-t4-made-easy-revisited#comment-46391</link>
		<dc:creator>Paul</dc:creator>
		<pubDate>Thu, 08 Sep 2011 08:09:59 +0000</pubDate>
		<guid isPermaLink="false">http://damieng.com/?p=1457#comment-46391</guid>
		<description>Hi Damien, you seem to know your T4 stuff - very handy include.

A quick question; I&#039;m generating a WCF service (the .svc and .cs file) via T4, everything works fine but for some reason Visual Studio separates the .svc and the .cs file - is there a way to make the .cs file be a shadow of the .svc as it usually does if you create the service manually?

Regards, Paul.</description>
		<content:encoded><![CDATA[<p>Hi Damien, you seem to know your T4 stuff &#8211; very handy include.</p>
<p>A quick question; I&#8217;m generating a WCF service (the .svc and .cs file) via T4, everything works fine but for some reason Visual Studio separates the .svc and the .cs file &#8211; is there a way to make the .cs file be a shadow of the .svc as it usually does if you create the service manually?</p>
<p>Regards, Paul.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tim</title>
		<link>http://damieng.com/blog/2009/11/06/multiple-outputs-from-t4-made-easy-revisited#comment-43525</link>
		<dc:creator>Tim</dc:creator>
		<pubDate>Tue, 14 Dec 2010 23:42:12 +0000</pubDate>
		<guid isPermaLink="false">http://damieng.com/?p=1457#comment-43525</guid>
		<description>Cool. Thanks for the feedback.. My code just has an extra section that preprocesses the header now. A little less efficient -- but its an offline process anyway :)
The mileage we get from the outputted code is immense. Thanks!</description>
		<content:encoded><![CDATA[<p>Cool. Thanks for the feedback.. My code just has an extra section that preprocesses the header now. A little less efficient &#8212; but its an offline process anyway :)<br />
The mileage we get from the outputted code is immense. Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Damien Guard</title>
		<link>http://damieng.com/blog/2009/11/06/multiple-outputs-from-t4-made-easy-revisited#comment-42992</link>
		<dc:creator>Damien Guard</dc:creator>
		<pubDate>Thu, 09 Dec 2010 17:14:16 +0000</pubDate>
		<guid isPermaLink="false">http://damieng.com/?p=1457#comment-42992</guid>
		<description>Yes, this template does not supports building one block in multiple places and I think it would add complexity to it that most people don&#039;t need.

[)amien</description>
		<content:encoded><![CDATA[<p>Yes, this template does not supports building one block in multiple places and I think it would add complexity to it that most people don&#8217;t need.</p>
<p>[)amien</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tim</title>
		<link>http://damieng.com/blog/2009/11/06/multiple-outputs-from-t4-made-easy-revisited#comment-42854</link>
		<dc:creator>Tim</dc:creator>
		<pubDate>Wed, 08 Dec 2010 04:44:05 +0000</pubDate>
		<guid isPermaLink="false">http://damieng.com/?p=1457#comment-42854</guid>
		<description>...Attempting to build the header in several different blocks...</description>
		<content:encoded><![CDATA[<p>&#8230;Attempting to build the header in several different blocks&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Damien Guard</title>
		<link>http://damieng.com/blog/2009/11/06/multiple-outputs-from-t4-made-easy-revisited#comment-42841</link>
		<dc:creator>Damien Guard</dc:creator>
		<pubDate>Tue, 07 Dec 2010 23:43:25 +0000</pubDate>
		<guid isPermaLink="false">http://damieng.com/?p=1457#comment-42841</guid>
		<description>Are you building the header in a single go after a normal block or attempting to build the header in several different blocks?

[)amien</description>
		<content:encoded><![CDATA[<p>Are you building the header in a single go after a normal block or attempting to build the header in several different blocks?</p>
<p>[)amien</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tim</title>
		<link>http://damieng.com/blog/2009/11/06/multiple-outputs-from-t4-made-easy-revisited#comment-42840</link>
		<dc:creator>Tim</dc:creator>
		<pubDate>Tue, 07 Dec 2010 23:38:18 +0000</pubDate>
		<guid isPermaLink="false">http://damieng.com/?p=1457#comment-42840</guid>
		<description>Damien,
Thanks for the help! Big time saver, but I have a really gnawing issue with it.
How come when I add to the header AFTER adding a normal block, the header information appears inline and not with the rest of the header? It would make better sense (to me), to output all header information inside the header, and not piecewise, throughout the file (this is only an issue when outputting a single file). Is this by design? From my app&#039;s POV its a bug.
Thoughts?</description>
		<content:encoded><![CDATA[<p>Damien,<br />
Thanks for the help! Big time saver, but I have a really gnawing issue with it.<br />
How come when I add to the header AFTER adding a normal block, the header information appears inline and not with the rest of the header? It would make better sense (to me), to output all header information inside the header, and not piecewise, throughout the file (this is only an issue when outputting a single file). Is this by design? From my app&#8217;s POV its a bug.<br />
Thoughts?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Luis Rocha</title>
		<link>http://damieng.com/blog/2009/11/06/multiple-outputs-from-t4-made-easy-revisited#comment-42680</link>
		<dc:creator>Luis Rocha</dc:creator>
		<pubDate>Tue, 16 Nov 2010 19:49:30 +0000</pubDate>
		<guid isPermaLink="false">http://damieng.com/?p=1457#comment-42680</guid>
		<description>Hi Damien, thanks a lot for providing this template!!

I&#039;ve been using your template since the first version, and now I started using it for the &lt;a href=&quot;http://chinookdatabase.codeplex.com/&quot; rel=&quot;nofollow&quot;&gt;Chinook Database&lt;/a&gt; to generate multiple sql and batch files. I noticed that the Manager class generates all files with UTF-8 encoding only. In my case, I need to created sql files with Unicode encoding, and batch files with ASCII encoding. 

I changed your original template and added an Encoding attribute to the Block class, and overloaded the StartNewFile method:

public void StartNewFile(String name) {
	StartNewFile(name, Encoding.UTF8);
}
	
public void StartNewFile(String name, Encoding encoding) {
	if (name == null)
		throw new ArgumentNullException(&quot;name&quot;);
	CurrentBlock = new Block { Name = name, Encoding = encoding };
}

Then, I used the block encoding in all calls to File.WriteAllText and to File.ReadAllText (to regenerate a file if its encoding has changed). This way we can control the encoding of the generated files. The modified version I am using is located &lt;a href=&quot;http://chinookdatabase.codeplex.com/SourceControl/changeset/view/4cd00ddeb6b9#ChinookDatabase%2f_T4Templates%2fManager.ttinclude&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;, just in case you want to integrate it.

Thanks again for this template!

Cheers,
Luis</description>
		<content:encoded><![CDATA[<p>Hi Damien, thanks a lot for providing this template!!</p>
<p>I&#8217;ve been using your template since the first version, and now I started using it for the <a href="http://chinookdatabase.codeplex.com/" rel="nofollow">Chinook Database</a> to generate multiple sql and batch files. I noticed that the Manager class generates all files with UTF-8 encoding only. In my case, I need to created sql files with Unicode encoding, and batch files with ASCII encoding. </p>
<p>I changed your original template and added an Encoding attribute to the Block class, and overloaded the StartNewFile method:</p>
<p>public void StartNewFile(String name) {<br />
	StartNewFile(name, Encoding.UTF8);<br />
}</p>
<p>public void StartNewFile(String name, Encoding encoding) {<br />
	if (name == null)<br />
		throw new ArgumentNullException(&#8220;name&#8221;);<br />
	CurrentBlock = new Block { Name = name, Encoding = encoding };<br />
}</p>
<p>Then, I used the block encoding in all calls to File.WriteAllText and to File.ReadAllText (to regenerate a file if its encoding has changed). This way we can control the encoding of the generated files. The modified version I am using is located <a href="http://chinookdatabase.codeplex.com/SourceControl/changeset/view/4cd00ddeb6b9#ChinookDatabase%2f_T4Templates%2fManager.ttinclude" rel="nofollow">here</a>, just in case you want to integrate it.</p>
<p>Thanks again for this template!</p>
<p>Cheers,<br />
Luis</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Dynamic page generated in 0.149 seconds. -->
<!-- Cached page generated by WP-Super-Cache on 2012-05-16 15:47:11 -->
<!-- Compression = gzip -->
