Compiling transformation and the 'Render' method

Apr 5, 2009 at 10:59 PM
Has anyone encountered the following error?
Error    1    Compiling transformation: 'Microsoft.VisualStudio.TextTemplating45B5C1FBF54E9AC6505AC5282008F683.GeneratedTextTransformation.TransformationContext' does not contain a definition for 'Render'    c:\Program Files\T4 Toolbox\T4Toolbox\Template.tt    85    35    Miscellaneous Files
The line of code in the Template.tt file is:
TransformationContext.Render(this);

I use VS2008, so my first guess is that the version of visual studio text transformation assembly is not the right one? Any ideas?
Coordinator
Apr 6, 2009 at 12:54 AM
Could you post the source code of your template?
Which version of T4 Toolbox are you using?

Thanks,
Oleg
Apr 6, 2009 at 1:03 AM
Hi Oleg,

I am using version 9.3.21.1 of T4.

The template is from CrudScaffolding project of the SharpArchitecture (http://code.google.com/p/sharp-architecture/).

The Code:

<#@ template language="C#" hostspecific="True" debug="True" #>
<#@ import namespace="System.Collections.Specialized" #>
<#@ output extension="txt" #>
<#@ include file="T4Toolbox.tt" #>
<#@ include file="./Templates/ScaffoldingGenerator.tt" #>
<#@ include file="EntityScaffoldingDetails.tt" #>

<#
EntityScaffoldingDetails newsEntityScaffoldingDetails =    new EntityScaffoldingDetails("News");

newsEntityScaffoldingDetails.EntityProperties.Add(new EntityProperty("Title", "string", "TestTitle", "[NotNull, NotEmpty]", true));
newsEntityScaffoldingDetails.EntityProperties.Add(new EntityProperty("Blurb", "string", "TestBlurb", "[NotNull, NotEmpty]", true));
newsEntityScaffoldingDetails.EntityProperties.Add(new EntityProperty("Article", "string", "TestArticle", "[NotNull, NotEmpty]", true));
newsEntityScaffoldingDetails.EntityProperties.Add(new EntityProperty("Author", "string", "TestAuthor", "[NotNull, NotEmpty]", true));
newsEntityScaffoldingDetails.EntityProperties.Add(new EntityProperty("ArticleDate", "DateTime", DateTime.Parse("1/1/2009")));

ScaffoldingGenerator generator = new ScaffoldingGenerator(
    @"C:\dev\Small Web Application Projects\XXX\YYY\", "XXX", newsEntityScaffoldingDetails);

// Uncomment this line when you're ready for the scaffolding generator to fire...be sure to recomment after it completes to avoid accidental generating!
//generator.Run();
#>
Coordinator
Apr 6, 2009 at 2:47 AM
Has Sharp Architecture been converted to use verion 9.3? I remember working with Billy to patch version 9.1 for S#arp Architecture to work correctly. This error may be the result of using version 9.3 of Template.tt with the old 9.1 version of TransformationContext.tt, which indeed didn't have a Render method.
Apr 6, 2009 at 3:18 AM
Edited Apr 6, 2009 at 3:20 AM
I guess we better check with Bill. I wonder if he reads this forum?

I am still waiting for the permission to post on the discussion group for Sharp Architecture.
Apr 6, 2009 at 4:48 AM
According to Bill, he hasn't had the chance to test Sharp Architecture with the latest versions T4. He recommends the use of the earlier patched version.

Check out the thread for the same issue on Sharp-Architecture Google Group: http://groups.google.com/group/sharp-architecture/browse_frm/thread/8c8d619268be89da
Coordinator
Apr 6, 2009 at 11:36 AM
Thanks for following up.