Asp.net-mvc – ASP.NET MVC Preview 5 on Mono

asp.net-mvcmono

Does anyone have any information about getting the current versions of ASP.NET MVC (Preview 5) working on Mono 2.0? There was info on the old versions (Preview 2, maybe Preview 3), but I've seen no details about making Preview 5 actually work.

The Mono Project Roadmap indicates ASP.NET 3.5 for Mono 2.4 (next year). Any ideas on how to get this useful before then?

More details: The basic MVC Preview 5 template seems to work, so long as I avoid the root directory. If I request the root, I get:

Server Error in '/' Application
The virtual path '' maps to another application.

Description: HTTP 500. Error processing request.

Stack Trace:

System.Web.HttpException: The virtual path '' maps to another application.
  at System.Web.HttpContext.RewritePath (System.String filePath, System.String pathInfo, System.String queryString, Boolean setClientFilePath) [0x00000] 
  at System.Web.HttpContext.RewritePath (System.String path, Boolean rebaseClientPath) [0x00000] 
  at System.Web.HttpContext.RewritePath (System.String path) [0x00000] 
  at MvcApplication1._Default.Page_Load (System.Object sender, System.EventArgs e) [0x00000] 
  at System.Web.UI.Control.OnLoad (System.EventArgs e) [0x00000] 
  at System.Web.UI.Control.LoadRecursive () [0x00000] 
  at System.Web.UI.Page.ProcessLoad () [0x00000] 
  at System.Web.UI.Page.ProcessPostData () [0x00000] 
  at System.Web.UI.Page.InternalProcessRequest () [0x00000] 
  at System.Web.UI.Page.ProcessRequest (System.Web.HttpContext context) [0x00000] 

Version information: Mono Version: 2.0.50727.42; ASP.NET Version: 2.0.50727.42

Best Answer

Well a potential is that RewritePath to / has some sort of bug, so just avoid that. Changing the RewritePath(Request.ApplicationPath) to:

HttpContext.Current.RewritePath("/Home/Index");

Seems to fix the problem, and at least the demo works so far.

Related Topic