RazorEngine<TBaseTemplateType>.CompileTemplate

Parses and compiles a markup template into an assembly and returns an assembly name. The name is an ID that can be passed to ExecuteTemplateByAssembly which picks up a cached instance of the loaded assembly.

public string CompileTemplate(string templateText,
	string generatedNamespace,
	string generatedClassName)

Return Value

An assembly Id. The Assembly is cached in memory and can be used with RenderFromAssembly.

Parameters

templateText
Text of the template to render

generatedNamespace
Namespace for the generated class. If not passed will be __RazorHosting

generatedClassName
Classname for the generated class. If not passed will be a generated unique name based on GUID

Remarks

The actual assembly isn't returned here to allow for cross-AppDomain operation. If the assembly was returned it would fail for cross-AppDomain calls.

Overloads:


See also:

Class RazorEngine

© West Wind Technologies, 2018 • Updated: 06/07/18
Comment or report problem with topic