Can't run an LPT template

Posts   
 
    
worldspawn avatar
worldspawn
User
Posts: 321
Joined: 26-Aug-2006
# Posted on: 22-Feb-2008 06:52:30   

Hi,

I'm trying to execute a template. It fails everytime with "object reference not..." etc. The error isn't caused by the content of the template because if i delete all my code and just have "Hello World" in there it still fails. If I delete the template i get a message saying template not found.

I'm not new to templates, but I am new to templates for version 2.5...

Heres the task definition


<taskPreset name="SD.Tasks.Base.ConsumeLptTemplate" displayName="List ASPX">
      <parameters>
        <parameter name="destinationFolder" value="Home" />
        <parameter name="filenameFormat" value="[elementName].aspx" />
        <parameter name="templateID" value="ListASPX" />
        <parameter name="emitType" value="allEntities" />
      </parameters>
    </taskPreset>

Stack:


-----[Core exception]--------------------
   at SD.LLBLGen.Pro.LptParser.DotNetTemplateEngine.Perform(IGenerator executingGenerator, ITask taskDefinition, Dictionary`2 parameters)
   at SD.LLBLGen.Pro.ApplicationCore.Tasks.Task.Perform(IGenerator executingGenerator, LogNode parentNode)
   at SD.LLBLGen.Pro.ApplicationCore.Tasks.TaskGroup.Perform(IGenerator executingGenerator, LogNode parentNode)
   at SD.LLBLGen.Pro.GeneratorCore.Generator.Start(ITaskGroup tasksToExecute, Project projectDefinition, Language languageToUse, Platform platformToUse, List`1 templateBindingsToUse, String templateGroupToUse, ApplicationConfiguration configurationSettings)
   at SD.LLBLGen.Pro.Gui.Forms.MainWindow.StartGeneratorProcess()

Walaa avatar
Walaa
Support Team
Posts: 14987
Joined: 21-Aug-2005
# Posted on: 22-Feb-2008 10:53:15   

Is your issue similar to what is discussed here? http://www.llblgen.com/TinyForum/Messages.aspx?ThreadID=11747

worldspawn avatar
worldspawn
User
Posts: 321
Joined: 26-Aug-2006
# Posted on: 24-Feb-2008 23:52:32   

Not really. I'm not using the CLI generator, i'm using the designer (or t-studio) and theres nothing non-default about their installations.

However the stack trace and exception are the same.

worldspawn avatar
worldspawn
User
Posts: 321
Joined: 26-Aug-2006
# Posted on: 25-Feb-2008 00:26:16   

I downloaded the SDK and debugged the Perform method.

The failure was happening at this line: templateObject.___RUN(executingGenerator, parameters, outputWriter, currentEntity);

because templateObject is null.

templateObject is null because of:

DotNetTemplateEngine.cs

1320 List<string> templateIDs = bindings.GetDistinctTemplateIDs( executingGenerator.LanguageToUse.Name, ".lpt" );

Because my templates were named .template and not .lpt.

disappointed

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39774
Joined: 17-Aug-2003
# Posted on: 25-Feb-2008 10:33:36   

That's indeed something to look out for: the extension defines what engine is used.

Frans Bouma | Lead developer LLBLGen Pro
worldspawn avatar
worldspawn
User
Posts: 321
Joined: 26-Aug-2006
# Posted on: 29-Feb-2008 01:16:52   

Not really expecting you to change anything, but I'll ask anyway:

You're storing the template language in the template bindings file (C#/VB/TDL)... can't you determine the template engine to use from that? Or if that's not succinct enough for you perhaps you add an additional piece of info to the bindings indicating the template engine to use. File extension dependency is soooo MS.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39774
Joined: 17-Aug-2003
# Posted on: 29-Feb-2008 10:11:57   

heh simple_smile Well, it was partly about backwards compatiblity: they were introduced without changing the format, which was easier for users, and also partly because it's less error prone (really! sunglasses ).

Frans Bouma | Lead developer LLBLGen Pro