Skip to content

Instantly share code, notes, and snippets.

@carlhoerberg
Created March 15, 2011 10:38
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save carlhoerberg/870574 to your computer and use it in GitHub Desktop.
Save carlhoerberg/870574 to your computer and use it in GitHub Desktop.
How to get precompiled mvc 3 site working in Mono 2.10
public class MonoWebFormViewEngine : WebFormViewEngine
{
protected override bool FileExists(ControllerContext controllerContext, string virtualPath)
{
return base.FileExists(controllerContext, virtualPath.Replace("~", ""));
}
}
public class MonoRazorViewEngine : RazorViewEngine
{
protected override bool FileExists(ControllerContext controllerContext, string virtualPath)
{
return base.FileExists(controllerContext, virtualPath.Replace("~", ""));
}
}
public class MvcApplication : System.Web.HttpApplication
{
protected void Application_Start()
{
ViewEngines.Engines.Clear();
ViewEngines.Engines.Add(new MonoWebFormViewEngine());
ViewEngines.Engines.Add(new MonoRazorViewEngine());
// The normal stuff..
}
}
@DavidS
Copy link

DavidS commented Mar 17, 2014

This is not required anymore. I can confirm that Mono 3.2.8 runs MVC4 without this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment