Class RazorEngineFactory<TBaseTemplateType>

Factory that creates a RazorHost instance in a remote AppDomain that can be unloaded. This allows unloading of assemblies created through scripting.

Both static and instance loader methods are available. For AppDomain created hosts.

Note: Only works for a single AppDomain as this class holds on to the AppDomain as a Singleton.

System.Object
  Westwind.RazorHosting.RazorEngineFactory<TBaseTemplateType>
public class RazorEngineFactory<TBaseTemplateType> : object

Class Members

MemberDescription

Constructor

Current

Internally managed instance of the HostFactory that ensures that the AppDomain stays alive and that it can be unloaded manually using the static methods.

CreateRazorHost

Create an instance of the RazorHost in the current AppDomain. No special handling...

public static RazorEngine CreateRazorHost(CSharpCodeProvider codeProvider)

CreateRazorHostInAppDomain

Creates an instance of the RazorHost in a new AppDomain. This version creates a static singleton that that is cached and you can call UnloadRazorHostInAppDomain to unload it.

public static RazorEngine CreateRazorHostInAppDomain(CSharpCodeProvider codeProvider)

GetRazorHost

Create a new instance of Razor Host in the current AppDomain.

public RazorEngine GetRazorHost(CSharpCodeProvider codeProvider)

GetRazorHostInAppDomain

Instance method that creates a RazorHost in a new AppDomain. This method requires that you keep the Factory around in order to keep the AppDomain alive and be able to unload it.

public RazorEngine GetRazorHostInAppDomain(CSharpCodeProvider codeProvider)

UnloadHost

Allow unloading of the created AppDomain to release resources All internal resources in the AppDomain are released including in memory compiled Razor assemblies.

public void UnloadHost()

UnloadRazorHostInAppDomain

Unloads the Razor host if running in a separate appdomain by unloading the AppDomain.

public static void UnloadRazorHostInAppDomain()

ErrorMessage

Requirements

Namespace: Westwind.RazorHosting
Assembly: westwind.razorhosting.dll

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