Asp.net-Mvc
Mono 上的 ASP.NET MVC 預覽版 5
有沒有人有任何關於讓目前版本的 ASP.NET MVC (Preview 5) 在 Mono 2.0 上工作的資訊?有關於舊版本的資訊(預覽 2,也許是預覽 3),但我沒有看到有關使預覽 5 實際工作的詳細資訊。
Mono 項目路線圖表明ASP.NET 3.5 用於 Mono 2.4(明年)。在此之前如何獲得這個有用的任何想法?
更多細節:基本的 MVC Preview 5 模板似乎可以工作,只要我避開根目錄。如果我請求根,我得到:
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
一個可能是 RewritePath to / 有某種錯誤,所以避免這種情況。將 RewritePath(Request.ApplicationPath) 更改為:
HttpContext.Current.RewritePath("/Home/Index");似乎解決了這個問題,至少到目前為止展示工作。
Asp.Net MVC 1.0 將與 mono 的 2.4 分支一起使用,但您仍需要在 default.aspx.cs 的頁面載入中修復 RewritePath