Files
Disco/Disco.Services/App_Start/RazorGeneratorMvcStart.cs
2025-07-20 13:47:56 +10:00

26 lines
749 B
C#

using RazorGenerator.Mvc;
using System.Web;
using System.Web.Mvc;
using System.Web.WebPages;
[assembly: WebActivatorEx.PostApplicationStartMethod(typeof(Disco.Services.App_Start.RazorGeneratorMvcStart), "Start")]
namespace Disco.Services.App_Start
{
public static class RazorGeneratorMvcStart
{
public static void Start()
{
var engine = new PrecompiledMvcEngine(typeof(RazorGeneratorMvcStart).Assembly)
{
UsePhysicalViewsIfNewer = HttpContext.Current.Request.IsLocal
};
ViewEngines.Engines.Insert(0, engine);
// StartPage lookups are done by WebPages.
VirtualPathFactoryManager.RegisterVirtualPathFactory(engine);
}
}
}