Can you recommend a .net template engine? [closed]

I am looking for a .net templating engine - something simple, lightweight, stable with not too many dependencies. All I need it for at the moment is creating templated plain text and html emails. Can anyone give me a good recommendation?

If it helps at all - something like Java's Freemarker or Velocity libraries.

[UPDATE] Thanks for the answers so far - much appreciated. I am really intested in recommendations or war stories from when you have used these libraries. Seems to be the best way to make a decision without trying each in turn.


Solution 1:

Here's a couple more:

  • NHaml
  • Spark
  • Brail (can be used standalone)

About NVelocity, it has been forked by the Castle guys, it's being developed here

For emails, I've never needed more than NVelocity.

Solution 2:

RazorEngine, A templating engine built on Microsoft's Razor parsing engine.

https://github.com/Antaris/RazorEngine

Haven't used it, but I find it interesting because if you have an ASP.NET MVC background, you won't need to learn something new.

Solution 3:

More Complete List

  • ASP.Net inbuilt WebForm View Engine
  • ASPView
  • Brail
  • NHaml (.Net port of Haml)
  • Spark
  • NVelocity
  • StringTemplate.Net

Solution 4:

I would recommend CodeSmith Generator. It is a template based code generator, with constant updates and an active community. Here is a list of templates that ship with CodeSmith Generator.