<?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: T4 Tutorial: Creating reusable code generation templates</title>
	<link>http://www.olegsych.com/2008/09/t4-tutorial-creating-reusable-code-generation-templates/</link>
	<description>Interfaces are like alcohol - they are a lot of fun when used in moderation.</description>
	<pubDate>Sat, 04 Feb 2012 05:50:02 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.3.3</generator>
		<item>
		<title>By: T4: Template and script &#124; Selfelected</title>
		<link>http://www.olegsych.com/2008/09/t4-tutorial-creating-reusable-code-generation-templates/#comment-3191</link>
		<dc:creator>T4: Template and script &#124; Selfelected</dc:creator>
		<pubDate>Thu, 22 Jul 2010 21:17:41 +0000</pubDate>
		<guid>http://www.olegsych.com/2008/09/t4-tutorial-creating-reusable-code-generation-templates/#comment-3191</guid>
		<description>[...] templates.  The method worked only for simple solutions.  Now, with VS2010 I recommend following http://www.olegsych.com/2008/09/t4-tutorial-creating-reusable-code-generation-templates/ to create more reusable [...]</description>
		<content:encoded><![CDATA[<p>[&#8230;] templates.  The method worked only for simple solutions.  Now, with VS2010 I recommend following http://www.olegsych.com/2008/09/t4-tutorial-creating-reusable-code-generation-templates/ to create more reusable [&#8230;]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Oleg Sych</title>
		<link>http://www.olegsych.com/2008/09/t4-tutorial-creating-reusable-code-generation-templates/#comment-3188</link>
		<dc:creator>Oleg Sych</dc:creator>
		<pubDate>Wed, 21 Jul 2010 11:20:26 +0000</pubDate>
		<guid>http://www.olegsych.com/2008/09/t4-tutorial-creating-reusable-code-generation-templates/#comment-3188</guid>
		<description>Nick,

This error is due to some new dependencies in the SMO implementation in SQL Server R2. This has nothing to do with T4 or the T4 Toolbox. You simply need to add the following assembly directive to the template:

&lt;#@ assembly name="Microsoft.SqlServer.Management.Sdk.Sfc" #&gt;</description>
		<content:encoded><![CDATA[<p>Nick,</p>
<p>This error is due to some new dependencies in the SMO implementation in SQL Server R2. This has nothing to do with T4 or the T4 Toolbox. You simply need to add the following assembly directive to the template:</p>
<p>< #@ assembly name="Microsoft.SqlServer.Management.Sdk.Sfc" #></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: nick</title>
		<link>http://www.olegsych.com/2008/09/t4-tutorial-creating-reusable-code-generation-templates/#comment-3187</link>
		<dc:creator>nick</dc:creator>
		<pubDate>Wed, 21 Jul 2010 10:35:27 +0000</pubDate>
		<guid>http://www.olegsych.com/2008/09/t4-tutorial-creating-reusable-code-generation-templates/#comment-3187</guid>
		<description>Looks like I spoke too soon - I'm not having any luck getting the toolbox to work. I reverted to trying to copy your example - which also does not work on my machine.

Apparently I need to:

 Error	4	Compiling transformation: The type 'Microsoft.SqlServer.Management.Sdk.Sfc.ISfcNotifyPropertyMetadataChanged' is defined in an assembly that is not referenced. You must add a reference to assembly 'Microsoft.SqlServer.Management.Sdk.Sfc, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91'.	c:\Users\nick\Documents\NonProj_Apps\t4 t2\t4 t2\DeleteProcedureTemplate.tt	12	9	

So reference this assembly and the error is still present. Really annoying.</description>
		<content:encoded><![CDATA[<p>Looks like I spoke too soon - I&#8217;m not having any luck getting the toolbox to work. I reverted to trying to copy your example - which also does not work on my machine.</p>
<p>Apparently I need to:</p>
<p> Error	4	Compiling transformation: The type &#8216;Microsoft.SqlServer.Management.Sdk.Sfc.ISfcNotifyPropertyMetadataChanged&#8217; is defined in an assembly that is not referenced. You must add a reference to assembly &#8216;Microsoft.SqlServer.Management.Sdk.Sfc, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91&#8242;.	c:\Users\nick\Documents\NonProj_Apps\t4 t2\t4 t2\DeleteProcedureTemplate.tt	12	9	</p>
<p>So reference this assembly and the error is still present. Really annoying.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: nick</title>
		<link>http://www.olegsych.com/2008/09/t4-tutorial-creating-reusable-code-generation-templates/#comment-3186</link>
		<dc:creator>nick</dc:creator>
		<pubDate>Wed, 21 Jul 2010 09:29:25 +0000</pubDate>
		<guid>http://www.olegsych.com/2008/09/t4-tutorial-creating-reusable-code-generation-templates/#comment-3186</guid>
		<description>Now that is fantastic. I'm really grateful for all your public work on T4 and I'm looking forward to making great use of the technology via the Toolbox.</description>
		<content:encoded><![CDATA[<p>Now that is fantastic. I&#8217;m really grateful for all your public work on T4 and I&#8217;m looking forward to making great use of the technology via the Toolbox.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Oleg Sych</title>
		<link>http://www.olegsych.com/2008/09/t4-tutorial-creating-reusable-code-generation-templates/#comment-2407</link>
		<dc:creator>Oleg Sych</dc:creator>
		<pubDate>Tue, 03 Nov 2009 14:19:35 +0000</pubDate>
		<guid>http://www.olegsych.com/2008/09/t4-tutorial-creating-reusable-code-generation-templates/#comment-2407</guid>
		<description>Updated the article and the sample source code to work with the latest version of T4 Toolbox (replaced RenderCore with TransformText).</description>
		<content:encoded><![CDATA[<p>Updated the article and the sample source code to work with the latest version of T4 Toolbox (replaced RenderCore with TransformText).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Oleg Sych</title>
		<link>http://www.olegsych.com/2008/09/t4-tutorial-creating-reusable-code-generation-templates/#comment-2323</link>
		<dc:creator>Oleg Sych</dc:creator>
		<pubDate>Sat, 10 Oct 2009 17:29:53 +0000</pubDate>
		<guid>http://www.olegsych.com/2008/09/t4-tutorial-creating-reusable-code-generation-templates/#comment-2323</guid>
		<description>T4Toolbox.tt no longer has the &lt;#@ assembly name=T4Toolbox" #&gt; directive because the assembly name is different under Visual Studio 2010. It is now referenced dynamically, by one of the directive processors. More on this &lt;a href="http://www.olegsych.com/2009/10/t4-toolbox-support-for-visual-studio-2010/" rel="nofollow"&gt;here&lt;/a&gt;.</description>
		<content:encoded><![CDATA[<p>T4Toolbox.tt no longer has the < #@ assembly name=T4Toolbox" #> directive because the assembly name is different under Visual Studio 2010. It is now referenced dynamically, by one of the directive processors. More on this <a href="http://www.olegsych.com/2009/10/t4-toolbox-support-for-visual-studio-2010/" rel="nofollow">here</a>.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nelis</title>
		<link>http://www.olegsych.com/2008/09/t4-tutorial-creating-reusable-code-generation-templates/#comment-2316</link>
		<dc:creator>Nelis</dc:creator>
		<pubDate>Fri, 09 Oct 2009 06:49:46 +0000</pubDate>
		<guid>http://www.olegsych.com/2008/09/t4-tutorial-creating-reusable-code-generation-templates/#comment-2316</guid>
		<description>I'm trying to figure out how the template knows where to find the namespace T4Toolbox as there is no assembly directive for it in T4Toolbox.tt.
Is it not needed because of the declared processors?</description>
		<content:encoded><![CDATA[<p>I&#8217;m trying to figure out how the template knows where to find the namespace T4Toolbox as there is no assembly directive for it in T4Toolbox.tt.<br />
Is it not needed because of the declared processors?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Oleg Sych</title>
		<link>http://www.olegsych.com/2008/09/t4-tutorial-creating-reusable-code-generation-templates/#comment-2159</link>
		<dc:creator>Oleg Sych</dc:creator>
		<pubDate>Tue, 25 Aug 2009 18:13:27 +0000</pubDate>
		<guid>http://www.olegsych.com/2008/09/t4-tutorial-creating-reusable-code-generation-templates/#comment-2159</guid>
		<description>Darren,

It sounds like your code looks like this:

&lt;pre&gt;void LoadTables()
{
   // ...
}

public class MultifileControllerTest
{
    void TestLoadTables()
    {
        LoadTables();
    }
}&lt;/pre&gt;

The problem here is that LoadTables is an instance method of the &lt;a href="http://www.olegsych.com/2008/05/t4-architecture/" rel="nofollow"&gt;GeneratedTextTransformation&lt;/a&gt; class. With &lt;a href="http://t4toolbox.codeplex.com" rel="nofollow"&gt;T4 Toolbox&lt;/a&gt; you could call it this way:

TransformationContext.Transformation.LoadTables();</description>
		<content:encoded><![CDATA[<p>Darren,</p>
<p>It sounds like your code looks like this:</p>
<pre>void LoadTables()
{
   // ...
}

public class MultifileControllerTest
{
    void TestLoadTables()
    {
        LoadTables();
    }
}</pre>
<p>The problem here is that LoadTables is an instance method of the <a href="http://www.olegsych.com/2008/05/t4-architecture/" rel="nofollow">GeneratedTextTransformation</a> class. With <a href="http://t4toolbox.codeplex.com" rel="nofollow">T4 Toolbox</a> you could call it this way:</p>
<p>TransformationContext.Transformation.LoadTables();</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Darren</title>
		<link>http://www.olegsych.com/2008/09/t4-tutorial-creating-reusable-code-generation-templates/#comment-2157</link>
		<dc:creator>Darren</dc:creator>
		<pubDate>Tue, 25 Aug 2009 17:02:02 +0000</pubDate>
		<guid>http://www.olegsych.com/2008/09/t4-tutorial-creating-reusable-code-generation-templates/#comment-2157</guid>
		<description>I am new to T4 templates and I'm having a problem with scope.

I'm including a file in my generator which declares a method called LoadTables()

When I try to use the method in my controller I get the following error.

"Cannot access a non-static member of outer type 'Microsoft.VisualStudio.TextTemplatingE192B65E6CF2C8BEF26D39CB464DA901.GeneratedTextTransformation' via nested type 'Microsoft.VisualStudio.TextTemplatingE192B65E6CF2C8BEF26D39CB464DA901.GeneratedTextTransformation.MultifileControllerTest'"

Is there any way to declare and use this method within the scope of MultifileControllerTest without bringing in the code?

Thanks for your help.</description>
		<content:encoded><![CDATA[<p>I am new to T4 templates and I&#8217;m having a problem with scope.</p>
<p>I&#8217;m including a file in my generator which declares a method called LoadTables()</p>
<p>When I try to use the method in my controller I get the following error.</p>
<p>&#8220;Cannot access a non-static member of outer type &#8216;Microsoft.VisualStudio.TextTemplatingE192B65E6CF2C8BEF26D39CB464DA901.GeneratedTextTransformation&#8217; via nested type &#8216;Microsoft.VisualStudio.TextTemplatingE192B65E6CF2C8BEF26D39CB464DA901.GeneratedTextTransformation.MultifileControllerTest&#8217;&#8221;</p>
<p>Is there any way to declare and use this method within the scope of MultifileControllerTest without bringing in the code?</p>
<p>Thanks for your help.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Visual Studio T4 template for SharePoint Feature Definition (Feature.xml) - Waldek Mastykarz</title>
		<link>http://www.olegsych.com/2008/09/t4-tutorial-creating-reusable-code-generation-templates/#comment-1992</link>
		<dc:creator>Visual Studio T4 template for SharePoint Feature Definition (Feature.xml) - Waldek Mastykarz</dc:creator>
		<pubDate>Sun, 16 Aug 2009 11:10:16 +0000</pubDate>
		<guid>http://www.olegsych.com/2008/09/t4-tutorial-creating-reusable-code-generation-templates/#comment-1992</guid>
		<description>[...] Depending on the type of SharePoint solutions you’re working with, you could easily extend the template to generate the ElementManifest elements as well and to exclude some files and directories from the Feature. All you have to know is the basic syntax of T4 templates. Oleg Sych did a great job of explaining the T4 engine from the very basic topics to some more advanced scenarios of how to reuse the templates across different projects and teams. [...]</description>
		<content:encoded><![CDATA[<p>[&#8230;] Depending on the type of SharePoint solutions you’re working with, you could easily extend the template to generate the ElementManifest elements as well and to exclude some files and directories from the Feature. All you have to know is the basic syntax of T4 templates. Oleg Sych did a great job of explaining the T4 engine from the very basic topics to some more advanced scenarios of how to reuse the templates across different projects and teams. [&#8230;]</p>
]]></content:encoded>
	</item>
</channel>
</rss>

