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(TextReader templateReader,
	string generatedNamespace,
	string generatedClassName)

Return Value

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

Parameters

templateReader
Textreader that loads the template

generatedNamespace
The namespace of the class to generate from the template. null generates name.

generatedClassName
The name of the class to generate from the template. null generates name.

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