Created
March 15, 2011 10:38
-
-
Save carlhoerberg/870574 to your computer and use it in GitHub Desktop.
How to get precompiled mvc 3 site working in Mono 2.10
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.. | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is not required anymore. I can confirm that Mono 3.2.8 runs MVC4 without this.