I just upgraded my project from ServiceStack 5.1 to 5.5.1. Now where I am using TemplateContext from ServiceStack.Templates it tells instead to use TemplateContext. Needless to say, this is likely a mistake in the description for the Obsolete attribute. What is the appropiate replacement for TemplateContext now in ServiceStack 5.5.1?
1 Answers
The depreciation message should’ve said to use ScriptContext
instead.
In the latest ServiceStack v5.5 Release ServiceStack Templates has been rebranded to #Script.
The section on Migration to new Script API's explains how to migrate in more detail:
Migrating to the new APIs is fairly straight forward:
- Change
using ServiceStack.Templates;
tousing ServiceStack.Script;
- Any classes with
TemplatePage*
has been renamed toSharpPage*
- Any other class with a
Template*
prefix has been renamed toScript*
This change doesn’t affect any of your existing #Script source code whose existing syntax and available filters/methods remains unchanged.
New Terminology
The primary rationale for the rebranding was so we’re better able to label, describe and document all of #Script
different features easier, so when referring to Templates View Engine we’re now calling Sharp Pages which is a better corollary to “Razor Pages” which it provides an alternative to.
Other re-branded features:
- API Pages are now called Sharp APIs
- Web Apps are now called Sharp Apps
- Template Filters are now called Script Methods
- Template Blocks are now called Script Blocks
The collection of methods you inject in your scripts like TemplateRedisFilters
and TemplateDbFilters
are now referred to as “Scripts” where they’ve been renamed to RedisScripts
and DbScripts
.

- 141,670
- 29
- 246
- 390