I want to put several template files on a directory named "Templates", relative to the executable of my application, and use them. One template file, for instance, is named "Globals.st".
That way, I created a TemplateGroupDirectory and loaded the template:
var group = new TemplateGroupDirectory("Templates");
var tmpl = group.GetInstanceOf("Globals");
On trying to get the instance of the template I've got a message saying that occurs a NullReferenceException.
What am I missing?
might be a syntax thing
heres an example:
string fullpath = Path.GetFullPath("templates/");
TemplateGroupDirectory tgd = new TemplateGroupDirectory(fullpath ,'<','>');
Template t = tgd.GetInstanceOf("helloworld");
t.Add("world", "shitty world");
i have a folder to named templates, with the file helloworld.st that contains
helloworld(world) ::= <<
hello, <world>
>>
My best guess is that it cannot find the .st file you need, remember to put copy on newer or always coby, on the .st files' properties, when you use relative paths, or else template will be nothing.