These are chat archives for Antaris/RazorEngine
Yes that's by design: There are really two points here: First is template instance creation, we don't allow it as we might need to save some internal state and therefore don't want to provide an API for it (note you still can define your own type if you need to!)
The other thing is re-using ITemplate instances: We don't allow that anymore for multiple reasons. First its not thread safe and second re-using is really error prone.
There is in fact a bug in your code: nested templates (layouts or includes) are not cached properly but recompiled more than actually required...
Therefore I recommend to not use RazorEngine with the legacy API and instead use the new API (sometimes you need to do/think a bit more, but its for the greater good :)