<?xml version="1.0"?><?xml-stylesheet type="text/xsl" href="/rss.xsl"?><rss version="2.0"><channel><title>T4 Toolbox</title><link>http://t4toolbox.codeplex.com/project/feeds/rss</link><description>T4 Toolbox is a set of ready-to-use code generators and T4 extensions for Visual Studio. Quickly build powerful C&amp;#35; or VB templates that generate multiple output files or simply use existing templates for LINQ to SQL, Entity Framework and more. </description><item><title>Closed Issue: LinqToSqlPrimaryKeyTemplate generates clustered primary key for UNIQUEIDENTIFIER columns. [13876]</title><link>http://t4toolbox.codeplex.com/workitem/13876</link><description>Clustered UNIQUEIDENTIFIER columns result in severe performance problems due to excessive page splitting. Should it generate a non-clustered key only for UNIQUEIDENTIFIER columns&amp;#63; Or, should it be an option&amp;#63;&lt;br /&gt;</description><author>OlegSych</author><pubDate>Thu, 16 May 2013 11:28:43 GMT</pubDate><guid isPermaLink="false">Closed Issue: LinqToSqlPrimaryKeyTemplate generates clustered primary key for UNIQUEIDENTIFIER columns. [13876] 20130516112843A</guid></item><item><title>Closed Issue: Error in DteProcessor.FindProjectItemCollection - incorrect ProjectItems instance returned for files in subfolders [17240]</title><link>http://t4toolbox.codeplex.com/workitem/17240</link><description>When generating an output file with setting Template.Output.File to some subdirectory, the DteProcessor.FindProjectItemCollection returns a ProjectItems instance pointing to the root directory of the project, not to the target subfolder. Then UpdateOutputFiles methods acts like the target file has been moved within the project structure. &amp;#40; &amp;#34;if &amp;#40;outputItem.Collection &amp;#33;&amp;#61; collection&amp;#41;&amp;#34; condition is then valid&amp;#41;&lt;br /&gt;I solved this issue by commenting out the condition in the FindProjectItemCollection method, that checks, whether the project is a database project. Then the loop on the end of the method is executed for any project kind and the correct ProjectItems collection is returned.&lt;br /&gt;</description><author>OlegSych</author><pubDate>Thu, 16 May 2013 11:28:39 GMT</pubDate><guid isPermaLink="false">Closed Issue: Error in DteProcessor.FindProjectItemCollection - incorrect ProjectItems instance returned for files in subfolders [17240] 20130516112839A</guid></item><item><title>New Post: Where to put code that use the generated files ?</title><link>http://t4toolbox.codeplex.com/discussions/442613</link><description>&lt;div style="line-height: normal;"&gt;Hi Oleg,&lt;br /&gt;
i use T4Toolbox since 5 years.&lt;br /&gt;
&lt;br /&gt;
I have a .tt file which generates N files by calling Render() on classes inheriting CSharpTemplate.&lt;br /&gt;
&lt;br /&gt;
At the end of the .tt file, i want to load one of the generated files, but the file never exists at this time. If i run the template by hand in VS2012, all files are generated ok.&lt;br /&gt;
&lt;br /&gt;
Where to put this code ?&lt;br /&gt;
&lt;br /&gt;
Benjamin.&lt;br /&gt;
&lt;/div&gt;</description><author>softlion</author><pubDate>Sun, 05 May 2013 18:17:46 GMT</pubDate><guid isPermaLink="false">New Post: Where to put code that use the generated files ? 20130505061746P</guid></item><item><title>Reviewed: 10.10 (四月 12, 2013)</title><link>https://t4toolbox.codeplex.com/releases/view/44623#ReviewBy-wangning08115</link><description>Rated 4 Stars &amp;#40;out of 5&amp;#41; - good&amp;#10;good&amp;#10;good</description><author>wangning08115</author><pubDate>Fri, 12 Apr 2013 09:04:48 GMT</pubDate><guid isPermaLink="false">Reviewed: 10.10 (四月 12, 2013) 20130412090448A</guid></item><item><title>New Post: Unknown Type CSharpTemplate</title><link>http://t4toolbox.codeplex.com/discussions/437156</link><description>&lt;div style="line-height: normal;"&gt;So in other words, when I add a new Template item to a project, the symbol &lt;em&gt;CSharpTemplate&lt;/em&gt; will be unresolved? Actually, I'll get no intellisense whatsoever for all T4Toolbox-related types and members, e.g. &lt;em&gt;TransformationContext&lt;/em&gt; or &lt;em&gt;CSharpTemplate&lt;/em&gt;, right? &lt;br /&gt;
At least, this is what's happening for me now and I wonder if this is normal or am I just doing something wrong. I have working T4 files, but everything from T4Toolbox is unrecognised, so it looks like there are errors in these files. Not to mention the fact, that lack of intellisense is painful while developing.&lt;br /&gt;
&lt;strong&gt;OlegSych wrote:&lt;/strong&gt;&lt;br /&gt;
&lt;blockquote&gt;
In Visual Studio 2010, there is a project item template that will automatically add the required reference to your project.&lt;br /&gt;
&lt;/blockquote&gt;
Have I understood you correctly then, that there are some references, that might be added manually in VS2012? Would that help?&lt;br /&gt;
I'd be pleased, if you'd explain this for me.&lt;br /&gt;
&lt;/div&gt;</description><author>slawekal</author><pubDate>Mon, 08 Apr 2013 20:38:18 GMT</pubDate><guid isPermaLink="false">New Post: Unknown Type CSharpTemplate 20130408083818P</guid></item><item><title>New Post: Moving T4 Toolbox LINQ to SQL classes generator into our source code</title><link>http://t4toolbox.codeplex.com/discussions/438390</link><description>&lt;div style="line-height: normal;"&gt;I've been looking into moving our Linq to SQL generation over to using T4 templates for some time now but have had a tough time finding a project that has been maintained and allows for at least results that are comparable with the out of the box experience offered by DBML within Visual Studio. &lt;br /&gt;
&lt;br /&gt;
I've checked out the T4 Toolbox along with many of your very informative posts and just recently began looking into how to use T4 Toolbox for the purpose described above. Unfortunately we are using Visual Studio 2012 and since your pulling out support for the out of the box generator for Linq to SQL I'm following your suggestion and looking for some support for how to get some of the capabilities pushed directly into our project source code. You did mention NuGet being a better source for distributing such T4 templates but I don't see any decent ones available for Linq to SQL that are not also trying to lock users into some new custom ORM. At this point I'm wondering how much effort it would take to pull out the LINQ to SQL related parts of the templates that used to be supplied with the T4 Toolkit and place them directly into my project. &lt;br /&gt;
&lt;br /&gt;
I've attempted to do this but after remapping a few files paths to point to a folder where I stuck the .tt files I get this result when trying to run my main DataContext level template DataClasses1.tt which looks like below.&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;#@ template language=&amp;quot;C#&amp;quot; debug=&amp;quot;True&amp;quot; #&amp;gt;
&amp;lt;#@ output extension=&amp;quot;cs&amp;quot; #&amp;gt;
&amp;lt;#@ include file=&amp;quot;T4Toolbox.tt&amp;quot; #&amp;gt;
&amp;lt;#@ include file=&amp;quot;LinqToSql.tt&amp;quot; #&amp;gt;
&amp;lt;#
    // Generate entity classes from a LINQ to SQL class model (.dbml file)
    LinqToSqlGenerator generator = new LinqToSqlGenerator();
    generator.DbmlFile = &amp;quot;DataClasses2.dbml&amp;quot;
    generator.Run();
#&amp;gt;&lt;/code&gt;&lt;/pre&gt;

When I do this see errors like the ones listed below which makes it look like I will need somehow to get the code parts of the T4 Toolbox like TransactSqlTemplate in order to get this stuff working. Seeing that I don't want to create my own Visual Studio add-in to get this working I was wondering if you could point me in the right direction or give a yes or no answer about where what I'm attempting to do is feasible given that I would rather spend less than a couple of hours to get this working.&lt;br /&gt;
&lt;br /&gt;
Error	1	Compiling transformation: The type or namespace name 'TransactSqlTemplate' could not be found (are you missing a using directive or an assembly reference?)	c:\Users\me\Documents\Visual Studio 2012\Projects\LinqToSqlT4TemplateTest\LinqToSqlT4TemplateTest\LinqToSql\LinqToSqlTableBase.tt	9	52	LinqToSqlT4TemplateTest&lt;br /&gt;
Error	2	Compiling transformation: The type or namespace name 'Database' could not be found (are you missing a using directive or an assembly reference?)	c:\Users\me\Documents\Visual Studio 2012\Projects\LinqToSqlT4TemplateTest\LinqToSqlT4TemplateTest\LinqToSql\LinqToSqlDataContextTemplate.tt	30	12	LinqToSqlT4TemplateTest&lt;br /&gt;
Error	3	Compiling transformation: The type or namespace name 'Connection' could not be found (are you missing a using directive or an assembly reference?)	c:\Users\me\Documents\Visual Studio 2012\Projects\LinqToSqlT4TemplateTest\LinqToSqlT4TemplateTest\LinqToSql\LinqToSqlDataContextTemplate.tt	137	34	LinqToSqlT4TemplateTest&lt;br /&gt;
Error	4	Compiling transformation: 'Microsoft.VisualStudio.TextTemplatingDFF1CCA611C0C4496ECFC13E4C4CD837B4EE01EAECC109EF12C6697C3023A14BFC1CB5084D3FAB4B5A337AF8F9B9E92D7E1B27894AF2916A961947C6928737EE.GeneratedTextTransformation.LinqToSqlDataContextTemplate.Database' is a 'property' but is used like a 'type'	c:\Users\me\Documents\Visual Studio 2012\Projects\LinqToSqlT4TemplateTest\LinqToSqlT4TemplateTest\LinqToSql\LinqToSqlDataContextTemplate.tt	166	34	LinqToSqlT4TemplateTest&lt;br /&gt;
Error	5	Compiling transformation: The type or namespace name 'Table' could not be found (are you missing a using directive or an assembly reference?)	c:\Users\me\Documents\Visual Studio 2012\Projects\LinqToSqlT4TemplateTest\LinqToSqlT4TemplateTest\LinqToSql\LinqToSqlDataContextTemplate.tt	191	34	LinqToSqlT4TemplateTest&lt;br /&gt;
Error	6	Compiling transformation: The type or namespace name 'Association' could not be found (are you missing a using directive or an assembly reference?)	c:\Users\me\Documents\Visual Studio 2012\Projects\LinqToSqlT4TemplateTest\LinqToSqlT4TemplateTest\LinqToSql\LinqToSqlEntityClassTemplate.tt	56	45	LinqToSqlT4TemplateTest&lt;br /&gt;
Error	7	Compiling transformation: The type or namespace name 'Column' could not be found (are you missing a using directive or an assembly reference?)	c:\Users\me\Documents\Visual Studio 2012\Projects\LinqToSqlT4TemplateTest\LinqToSqlT4TemplateTest\LinqToSql\LinqToSqlEntityClassTemplate.tt	62	45	LinqToSqlT4TemplateTest&lt;br /&gt;
Error	8	Compiling transformation: 'Microsoft.VisualStudio.TextTemplatingDFF1CCA611C0C4496ECFC13E4C4CD837B4EE01EAECC109EF12C6697C3023A14BFC1CB5084D3FAB4B5A337AF8F9B9E92D7E1B27894AF2916A961947C6928737EE.GeneratedTextTransformation.LinqToSqlEntityClassTemplate.AccessModifier(Association)' is a 'method' but is used like a 'type'	c:\Users\me\Documents\Visual Studio 2012\Projects\LinqToSqlT4TemplateTest\LinqToSqlT4TemplateTest\LinqToSql\LinqToSqlEntityClassTemplate.tt	1343	36	LinqToSqlT4TemplateTest&lt;br /&gt;
Error	9	Compiling transformation: The type or namespace name 'MemberModifier' could not be found (are you missing a using directive or an assembly reference?)	c:\Users\me\Documents\Visual Studio 2012\Projects\LinqToSqlT4TemplateTest\LinqToSqlT4TemplateTest\LinqToSql\LinqToSqlEntityClassTemplate.tt	1354	36	LinqToSqlT4TemplateTest&lt;br /&gt;
Error	10	Compiling transformation: 'Microsoft.VisualStudio.TextTemplatingDFF1CCA611C0C4496ECFC13E4C4CD837B4EE01EAECC109EF12C6697C3023A14BFC1CB5084D3FAB4B5A337AF8F9B9E92D7E1B27894AF2916A961947C6928737EE.GeneratedTextTransformation.LinqToSqlTableBaseTemplate.Table' is a 'property' but is used like a 'type'	c:\Users\me\Documents\Visual Studio 2012\Projects\LinqToSqlT4TemplateTest\LinqToSqlT4TemplateTest\LinqToSql\LinqToSqlTableBase.tt	46	40	LinqToSqlT4TemplateTest&lt;br /&gt;
Error	11	A namespace cannot directly contain members such as fields or methods	C:\Users\me\Documents\Visual Studio 2012\Projects\LinqToSqlT4TemplateTest\LinqToSqlT4TemplateTest\DataClasses1.cs	1	1	LinqToSqlT4TemplateTest&lt;br /&gt;
Error	12	A namespace cannot directly contain members such as fields or methods	C:\Users\me\Documents\Visual Studio 2012\Projects\LinqToSqlT4TemplateTest\LinqToSqlT4TemplateTest\LinqToSql.cs	1	1	LinqToSqlT4TemplateTest&lt;br /&gt;
&lt;/div&gt;</description><author>kainhart</author><pubDate>Thu, 28 Mar 2013 23:13:15 GMT</pubDate><guid isPermaLink="false">New Post: Moving T4 Toolbox LINQ to SQL classes generator into our source code 20130328111315P</guid></item><item><title>New Post: running t4 script file from the command prompt</title><link>http://t4toolbox.codeplex.com/discussions/437636</link><description>&lt;div style="line-height: normal;"&gt;While you can transform simple text templates using &lt;a href="http://msdn.microsoft.com/en-us/library/bb126245.aspx" rel="nofollow"&gt;TextTransform&lt;/a&gt;, the T4 runtime environment it provides is completely different from Visual Studio. T4 Toolbox does not support TextTransform at this time.&lt;br /&gt;
&lt;/div&gt;</description><author>OlegSych</author><pubDate>Sun, 24 Mar 2013 16:04:56 GMT</pubDate><guid isPermaLink="false">New Post: running t4 script file from the command prompt 20130324040456P</guid></item><item><title>New Post: running t4 script file from the command prompt</title><link>http://t4toolbox.codeplex.com/discussions/437636</link><description>&lt;div style="line-height: normal;"&gt;I have a  VS 2012 console project which generates the code files by using T4 Toolbox. Currently, I run the code generation script file by selecting 'Run custom Tool' from the popup menu in VS. I wonder if I can run the script file from the Command Prompt.&lt;br /&gt;
&lt;/div&gt;</description><author>tjdwl</author><pubDate>Fri, 22 Mar 2013 14:25:53 GMT</pubDate><guid isPermaLink="false">New Post: running t4 script file from the command prompt 20130322022553P</guid></item><item><title>Closed Issue: Syntax Highlighting interferes with Tangible T4 [24094]</title><link>http://t4toolbox.codeplex.com/workitem/24094</link><description>When running the T4Toolbox Extension the syntax highlighting options interfere with Tangible&amp;#39;s highlighting &amp;#40;Turning off the highlighting in options doesn&amp;#39;t restore the Tangible Highlighting&amp;#41;.&lt;br /&gt;&lt;br /&gt;Is there a way to configure the add-in to not perform highlighting for T4 and not interfere with any existing syntax highlighters&amp;#63;&lt;br /&gt;Comments: T4 Toolbox stops syntax highlighting as soon as you click "OK" in the options dialog. I would expect Tangible to take over at that point, or at least after you close and reopen the file. Having to disable and re-enable the extension is a non-ideal workaround. I will take a closer look if this affects a lot of people.</description><author>OlegSych</author><pubDate>Fri, 22 Mar 2013 01:50:57 GMT</pubDate><guid isPermaLink="false">Closed Issue: Syntax Highlighting interferes with Tangible T4 [24094] 20130322015057A</guid></item><item><title>Commented Issue: Syntax Highlighting interferes with Tangible T4 [24094]</title><link>http://t4toolbox.codeplex.com/workitem/24094</link><description>When running the T4Toolbox Extension the syntax highlighting options interfere with Tangible&amp;#39;s highlighting &amp;#40;Turning off the highlighting in options doesn&amp;#39;t restore the Tangible Highlighting&amp;#41;.&lt;br /&gt;&lt;br /&gt;Is there a way to configure the add-in to not perform highlighting for T4 and not interfere with any existing syntax highlighters&amp;#63;&lt;br /&gt;Comments: ** Comment from web user: tankbob ** &lt;p&gt;That's weird, disabling and re-enabling the T4 Toolbox extension seems to have restored the Tangible functionality.&lt;/p&gt;</description><author>tankbob</author><pubDate>Thu, 21 Mar 2013 21:37:38 GMT</pubDate><guid isPermaLink="false">Commented Issue: Syntax Highlighting interferes with Tangible T4 [24094] 20130321093738P</guid></item><item><title>Created Issue: Syntax Highlighting interferes with Tangible T4 [24094]</title><link>http://t4toolbox.codeplex.com/workitem/24094</link><description>When running the T4Toolbox Extension the syntax highlighting options interfere with Tangible&amp;#39;s highlighting &amp;#40;Turning off the highlighting in options doesn&amp;#39;t restore the Tangible Highlighting&amp;#41;.&lt;br /&gt;&lt;br /&gt;Is there a way to configure the add-in to not perform highlighting for T4 and not interfere with any existing syntax highlighters&amp;#63;&lt;br /&gt;</description><author>tankbob</author><pubDate>Thu, 21 Mar 2013 21:32:04 GMT</pubDate><guid isPermaLink="false">Created Issue: Syntax Highlighting interferes with Tangible T4 [24094] 20130321093204P</guid></item><item><title>New Post: T4ScriptFileGenerator VS2012</title><link>http://t4toolbox.codeplex.com/discussions/437168</link><description>&lt;div style="line-height: normal;"&gt;In Visual Studio 2012 the name of the Custom Tool is T4Toolbox.ScriptFileGenerator.&lt;br /&gt;
&lt;/div&gt;</description><author>OlegSych</author><pubDate>Thu, 21 Mar 2013 14:13:38 GMT</pubDate><guid isPermaLink="false">New Post: T4ScriptFileGenerator VS2012 20130321021338P</guid></item><item><title>New Post: Unknown Type CSharpTemplate</title><link>http://t4toolbox.codeplex.com/discussions/437156</link><description>&lt;div style="line-height: normal;"&gt;T4Toolbox in Visual Studio 2012 does not support pre-processed templates at this time. In Visual Studio 2010, there is a project item template that will automatically add the required reference to your project.&lt;br /&gt;
&lt;/div&gt;</description><author>OlegSych</author><pubDate>Thu, 21 Mar 2013 14:12:41 GMT</pubDate><guid isPermaLink="false">New Post: Unknown Type CSharpTemplate 20130321021241P</guid></item><item><title>New Post: T4ScriptFileGenerator VS2012</title><link>http://t4toolbox.codeplex.com/discussions/437168</link><description>&lt;div style="line-height: normal;"&gt;Ho do you make an xml file generate a template with T4ScriptFileGenerator?&lt;br /&gt;
&lt;br /&gt;
I try adding &amp;quot;T4ScriptFileGenerator&amp;quot; as a Custom Tool on my xml file in my project, but nothing happens.&lt;br /&gt;
&lt;/div&gt;</description><author>mika76</author><pubDate>Tue, 19 Mar 2013 10:02:23 GMT</pubDate><guid isPermaLink="false">New Post: T4ScriptFileGenerator VS2012 20130319100223A</guid></item><item><title>New Post: Unknown Type CSharpTemplate</title><link>http://t4toolbox.codeplex.com/discussions/437156</link><description>&lt;div style="line-height: normal;"&gt;I am trying to create a preprocessed template in my project.  The problem is that I continue to get an unknown type.  I am assuming that I need to add a reference to my project but I am not sure where to find the dll.  Can you please point me in the right direction.&lt;br /&gt;
&lt;/div&gt;</description><author>kmcbrearty</author><pubDate>Tue, 19 Mar 2013 06:34:34 GMT</pubDate><guid isPermaLink="false">New Post: Unknown Type CSharpTemplate 20130319063434A</guid></item><item><title>New Post: Using T4 Toolbox To Generate Java Executables</title><link>http://t4toolbox.codeplex.com/discussions/434751</link><description>&lt;div style="line-height: normal;"&gt;Never mind.&lt;br /&gt;
&lt;br /&gt;
I think I fixed it.&lt;br /&gt;
&lt;br /&gt;
The variable declaration needed to be at the bottom&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;#@ template language=&amp;quot;C#&amp;quot; #&amp;gt;
&amp;lt;#@ template debug=&amp;quot;true&amp;quot; #&amp;gt;
&amp;lt;#@ assembly name=&amp;quot;System.Core&amp;quot; #&amp;gt;
&amp;lt;#@ import namespace=&amp;quot;System.Linq&amp;quot; #&amp;gt;
&amp;lt;#@ import namespace=&amp;quot;System.Text&amp;quot; #&amp;gt;
&amp;lt;#@ import namespace=&amp;quot;System.Collections.Generic&amp;quot; #&amp;gt;

&amp;lt;#= stringVal #&amp;gt; 

&amp;lt;#+ public string stringVal;  #&amp;gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;</description><author>drdexter333</author><pubDate>Mon, 04 Mar 2013 17:15:30 GMT</pubDate><guid isPermaLink="false">New Post: Using T4 Toolbox To Generate Java Executables 20130304051530P</guid></item><item><title>New Post: Using T4 Toolbox To Generate Java Executables</title><link>http://t4toolbox.codeplex.com/discussions/434751</link><description>&lt;div style="line-height: normal;"&gt;Ok, So i set everything up like so in my form:&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;using (myStream = openFileDialog1.OpenFile())
{
string file = Path.GetFileName(openFileDialog1.InitialDirectory + openFileDialog1.FileName);
string text = File.ReadAllText(openFileDialog1.FileName);
    try
    {
        MacroTemplate mt = new MacroTemplate();
        mt.stringVal = text;
        File.WriteAllText(&amp;quot;MyClass.java&amp;quot;, mt.TransformText());
    }
    catch (Exception ex)
    {
       MessageBox.Show(&amp;quot;An error occurred&amp;quot; + ex.GetBaseException());
    }
}            &lt;/code&gt;&lt;/pre&gt;

Then in my template:&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;#@ template language=&amp;quot;C#&amp;quot; #&amp;gt;
&amp;lt;#@ template debug=&amp;quot;true&amp;quot; #&amp;gt;

&amp;lt;#+
    public string stringVal;
    
#&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

My java file is empty and I cannot figure out how to write output statement in the template file since each time I attempt to code a block following this line:&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;#+
    public string stringVal;
    
#&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

I get this error:&lt;br /&gt;
Error	1	A Statement cannot appear after the first class feature in the template. Only boilerplate, expressions and other class features are allowed after the first class feature block.&lt;br /&gt;
&lt;br /&gt;
How do i write this variable out to the file?&lt;br /&gt;
&lt;br /&gt;
Thanks&lt;br /&gt;
&lt;br /&gt;
Doug&lt;br /&gt;
&lt;/div&gt;</description><author>drdexter333</author><pubDate>Mon, 04 Mar 2013 16:33:54 GMT</pubDate><guid isPermaLink="false">New Post: Using T4 Toolbox To Generate Java Executables 20130304043354P</guid></item><item><title>New Post: Windows Forms and Generating Code</title><link>http://t4toolbox.codeplex.com/discussions/435130</link><description>&lt;div style="line-height: normal;"&gt;You might want to start here: &lt;a href="http://msdn.microsoft.com/en-us/library/ee844259.aspx" rel="nofollow"&gt;http://msdn.microsoft.com/en-us/library/ee844259.aspx&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;</description><author>OlegSych</author><pubDate>Mon, 04 Mar 2013 03:07:03 GMT</pubDate><guid isPermaLink="false">New Post: Windows Forms and Generating Code 20130304030703A</guid></item><item><title>New Post: Using T4 Toolbox To Generate Java Executables</title><link>http://t4toolbox.codeplex.com/discussions/434751</link><description>&lt;div style="line-height: normal;"&gt;In a Windows application, you can only use a preprocessed (a.k.a. runtime) template. Look at the .CS file the runtime template generates in your project to understand how to use it. You probably want to declare the &amp;quot;stringVal&amp;quot; as a property in a class feature block. &lt;br /&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;#+ 
    public string StringVal;
#&amp;gt;&lt;/code&gt;&lt;/pre&gt;

That way, you will be able to set it in your windows form like so:&lt;br /&gt;
&lt;br /&gt;
preMacro macro = new preMacro();&lt;br /&gt;
macro.StringVal = &amp;quot;Value&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
After that, you can save the generated code in a .java file:&lt;br /&gt;
&lt;br /&gt;
File.WriteAllText(&amp;quot;MyClass.java&amp;quot;, macro.TransformText());&lt;br /&gt;
&lt;br /&gt;
You may find the following articles helpful in understanding preprocessed templates: &lt;a href="http://msdn.microsoft.com/en-us/library/ee844259.aspx" rel="nofollow"&gt;http://msdn.microsoft.com/en-us/library/ee844259.aspx&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;</description><author>OlegSych</author><pubDate>Mon, 04 Mar 2013 03:05:24 GMT</pubDate><guid isPermaLink="false">New Post: Using T4 Toolbox To Generate Java Executables 20130304030524A</guid></item><item><title>New Post: Windows Forms and Generating Code</title><link>http://t4toolbox.codeplex.com/discussions/435130</link><description>&lt;div style="line-height: normal;"&gt;I'm kind of struggling in an attempt to create a dynamic code generator using T4&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;I have a windows app that reads mutilple files.&lt;/li&gt;
&lt;li&gt;
For each file read, I need to collection of code snippets, in a java file.&lt;br /&gt;
&lt;/li&gt;
&lt;/ol&gt;
I used Tangible t4 Editor and created a new tt file like this:&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;#@ template debug=&amp;quot;true&amp;quot; hostSpecific=&amp;quot;true&amp;quot; #&amp;gt;
&amp;lt;#@ output extension=&amp;quot;.java&amp;quot; #&amp;gt;
&amp;lt;#@ Assembly Name=&amp;quot;System.Core&amp;quot; #&amp;gt;
&amp;lt;#@ Assembly Name=&amp;quot;System.Windows.Forms&amp;quot; #&amp;gt;
&amp;lt;#@ import namespace=&amp;quot;System&amp;quot; #&amp;gt;
&amp;lt;#@ import namespace=&amp;quot;System.IO&amp;quot; #&amp;gt;
&amp;lt;#@ import namespace=&amp;quot;System.Diagnostics&amp;quot; #&amp;gt;
&amp;lt;#@ import namespace=&amp;quot;System.Linq&amp;quot; #&amp;gt;
&amp;lt;#@ import namespace=&amp;quot;System.Collections&amp;quot; #&amp;gt;
&amp;lt;#@ import namespace=&amp;quot;System.Collections.Generic&amp;quot; #&amp;gt; 
&amp;lt;#
   // insert your template code here the tempalte code will be syntaxhighlighted 
   // and you will have intellisense for all namespaces in the full edition
   string Greeting = &amp;quot;Hello&amp;quot;;
#&amp;gt;
// This is the output code from your template
// you only get syntax-highlighting here - not intellisense
namespace JAVA_UTILITY{
  class MyGeneratedClass{
     static void main (string[] args){
       System.Console.WriteLine(&amp;quot;&amp;lt;#= Greeting #&amp;gt;, the time is now: &amp;lt;#=System.DateTime.Now.ToString() #&amp;gt;&amp;quot;);
}

     
     
  }

&amp;lt;#+
  // Insert any template procedures here
  void foo(){}
#&amp;gt;&lt;/code&gt;&lt;/pre&gt;

The problem I am having a hard time wrapping my head around is, &lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;How this tt.file gets called at run time &lt;/li&gt;
&lt;li&gt;
How do I  access and set say a collection of properties within this .tt file?&lt;br /&gt;
&lt;/li&gt;
&lt;/ol&gt;
Thanks in advance for any help.&lt;br /&gt;
&lt;br /&gt;
Doug&lt;br /&gt;
&lt;/div&gt;</description><author>drdexter333</author><pubDate>Sat, 02 Mar 2013 18:30:56 GMT</pubDate><guid isPermaLink="false">New Post: Windows Forms and Generating Code 20130302063056P</guid></item></channel></rss>