Debugging Custom Templates

Posts   
 
    
Posts: 56
Joined: 08-Jun-2010
# Posted on: 09-Jun-2010 12:45:21   

Hello

I am using llblgen 3 on a demo licence

Following a recomendation on an earlier thread I have created a very simple .lpt template. I have added this in by creating a templatebinding and adding a SD.Tasks.Base.ConsumeLptTemplate task to the run queue.

when I start the generator I get a null reference exception when It hits my template. The details (which I've pasted below) give me no indication as to the problem.

Is there a way to debug templates? Any idea what is happening in this case?

Thanks

~Brett

My Template:

<% EntityDefinition entity = (EntityDefinition)_activeObject; %>

using System; using System.Data.Linq; using System.Data.Linq.Mapping; using System.ComponentModel;

namespace <%=_executingGenerator.RootNamespaceToUse%>.DTOClasses { /// <summary>Class which represents the entity </summary> public partial class <%=entity.Name%> { public string myname; } }

Details of exception:

-----[Core exception]-------------------- at test_dto.__ScriptCode() at SD.LLBLGen.Pro.LptParser.DotNetTemplateEngine.CallTemplateEmitter[TElement](Assembly compiledTemplatesAssembly, String templateID, Dictionary2 parameters, StreamWriter outputWriter, TElement currentElement) at SD.LLBLGen.Pro.GeneratorCore.CodeGenerationEngineBase.EmitOutputToFile[TElement](TElement currentElement, String destinationFilename, Boolean failWhenExistent, Assembly compiledTemplatesAssembly, String templateID, Dictionary2 parameters, Boolean isPartOfSet, String outputDescription) at SD.LLBLGen.Pro.GeneratorCore.CodeGenerationEngineBase.EmitOutput(Dictionary2 parameters, String fullPath, String templateID, Assembly compiledTemplatesAssembly, EmitType emitTypeToPerform, String filenameFormat, Boolean failWhenExistent) at SD.LLBLGen.Pro.LptParser.DotNetTemplateEngine.Perform(IGenerator executingGenerator, ITask taskDefinition, Dictionary2 parameters) at SD.LLBLGen.Pro.ApplicationCore.CodeGenerationMetaData.Tasks.Task.PerformElement(IGenerator executingGenerator, LogNode parentNode) at SD.LLBLGen.Pro.ApplicationCore.CodeGenerationMetaData.Tasks.TaskGroupElement.Perform(IGenerator executingGenerator, LogNode parentNode) at SD.LLBLGen.Pro.ApplicationCore.CodeGenerationMetaData.Tasks.TaskGroup.PerformElement(IGenerator executingGenerator, LogNode parentNode) at SD.LLBLGen.Pro.ApplicationCore.CodeGenerationMetaData.Tasks.TaskGroupElement.Perform(IGenerator executingGenerator, LogNode parentNode) at SD.LLBLGen.Pro.GeneratorCore.Generator.RunTasks(String rootNameSpaceToUse, String destinationRootFolder, String groupName) at SD.LLBLGen.Pro.GeneratorCore.Generator.Start(ITaskGroup tasksToExecute, ApplicationConfiguration configurationSettings, Language languageToUse, Platform platformToUse, List1 templateBindingsToUse, String templateGroupToUse, String rootNameSpaceToUse, String destinationRootFolder, Project projectDefinition, CodeGenerationCycleOutputType outputType) at SD.LLBLGen.Pro.GeneratorCore.Generator.Start(ITaskGroup tasksToExecute, CodeGenerationCyclePreferences preferences, ApplicationConfiguration configurationSettings, Project projectDefinition) at SD.LLBLGen.Pro.Gui.Classes.GuiController.PerformRunCodeGenerationCycleAction(ITaskGroup toExecute, CodeGenerationCyclePreferences codeGenerationCyclePreferences, HashSet1 entitiesToUse, HashSet1 spCallsToUse, HashSet1 typedViewsToUse, HashSet1 typedListsToUse, HashSet1 valueTypesToUse, LogNode& tasksResultLog)

Walaa avatar
Walaa
Support Team
Posts: 14986
Joined: 21-Aug-2005
# Posted on: 09-Jun-2010 15:23:49   

Please check the following sectin from v.2.6 SDK documentation.

Templates & Template Bindings -> Lpt templates engine (.lpt templates) -> Debugging.

Posts: 56
Joined: 08-Jun-2010
# Posted on: 09-Jun-2010 16:06:35   

Thats Great, Where can I get that sdk documentation from?

Walaa avatar
Walaa
Support Team
Posts: 14986
Joined: 21-Aug-2005
# Posted on: 09-Jun-2010 16:37:42   

You don't have a license for v.2.6, have you?

Posts: 56
Joined: 08-Jun-2010
# Posted on: 09-Jun-2010 17:08:17   

Actually Yes, I do have a license for 2.6. I don't have it installed though.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39767
Joined: 17-Aug-2003
# Posted on: 09-Jun-2010 18:26:04   

BrettBailey wrote:

Actually Yes, I do have a license for 2.6. I don't have it installed though.

Simply login to the customer area-> v2.6 -> extras section

Frans Bouma | Lead developer LLBLGen Pro