I am working on a project that generates code at runtime based on meta-model. I've used vb.net xml literals for this, but today I ran across StringTemplate project. Has anybody successfully used this library in C# project.
Asked
Active
Viewed 883 times
5
-
Yep. I used it to generate text files. Very easy to use. – RichardOD Aug 28 '09 at 14:41
-
Did you use .net2.0 binary distribution? I tried source code one but it won't compile. – epitka Aug 28 '09 at 14:51
-
Is your output XML, or plain text? – Pavel Minaev Nov 13 '09 at 20:46
-
plain text, outputs code – epitka Nov 13 '09 at 23:24
1 Answers
7
StringTemplate is probably the most awesome and well-designed templating engine in existence today. It's definitely a good pick regardless of the language/platform you use.
On the other hand, ther's also T4, which is "more standard" (comes with VS, reusable, a lot of .NET devs know it already), and in VS2010 it comes with "precompiled templates", where your template is converted to raw C# code at design time, which is compiled as part of your project - which is fast, and has no runtime dependencies.

Pavel Minaev
- 99,783
- 25
- 219
- 289