I am trying to generate custom code using include templates. I have followed the example in "Generated code - Adding your own code to the generated classes" in v4 Framework Documentation. I have added a template binding Custom_EntityAdapterTemplate to a file named EntityInclude.lpt. In the lpt file, I have added the following code:
Public Function TestMyFunction() as String
Return "Test"
End Function
When I Generate source-code, I get the following exception:
Compilation of templates threw errors:
Error BC30800, at line: 78, pos: 0: Method arguments must be enclosed in parentheses.
Error BC30037, at line: 78, pos: 0: Character is not valid.
Error BC30287, at line: 80, pos: 0: '.' expected.
Error BC30035, at line: 82, pos: 0: Syntax error.
Error BC30072, at line: 83, pos: 0: 'Case' can only appear inside a 'Select Case' statement.
Error BC30037, at line: 84, pos: 0: Character is not valid.
Error BC30037, at line: 85, pos: 0: Character is not valid.
Error BC30072, at line: 86, pos: 0: 'Case' can only appear inside a 'Select Case' statement.
Error BC30037, at line: 87, pos: 0: Character is not valid.
.
.
.
Error BC30041, at line: 0, pos: 0: Maximum number of errors has been exceeded.
Stack trace:
LLBLGen Pro version 4.0. Build April 11th, 2013
-----[Core exception]--------------------
at SD.LLBLGen.Pro.LptParser.DotNetTemplateEngine.CompileForTDLIncludeTemplates(ITask taskDefinition)
at SD.LLBLGen.Pro.TaskPerformers.CodeEmitter.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.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, List
1 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, HashSet
1 spCallsToUse, HashSet1 typedViewsToUse, HashSet
1 typedListsToUse, HashSet1 valueTypesToUse, HashSet
1 tvfCallsTouse, List`1 vsNetProjectsCreated, LogNode& tasksResultLog)
Any ideas as to what I may be doing wrong? When I use TDL type templates, I do not have a problem generating custom code.