Search code examples
.netstringtemplate

How to let StringTemplate.NET to load template files with the extension ".dwt"?


The default template file extension of StringTemplate is ".st". Now I have several template files in a folder and their file extension is ".dwt". Is there a way to change the default template file extension and load all of them like below:

StringTemplateGroup group = new StringTemplateGroup("views", viewPath);

Solution

  • A rather big hack that might work is to copy all the templates to a temp directory, but with the correct default extension type.