ASP.NET MVC Preview 5 on Mono

前端 未结 3 707
醉话见心
醉话见心 2020-12-03 06:05

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 Prev

相关标签:
3条回答
  • 2020-12-03 06:29

    Are you using Mono from svn or stable? What kind of webserver are you using? What kind of Operating system? Do you have rewrite rules in your web server?

    I can run preview 4 in Linux with this in the page_load method in default.aspx.cs

    HttpContext.Current.RewritePath(Request.ApplicationPath);
     ((IHttpHandler)new MvcHttpHandler()).ProcessRequest(HttpContext.Current);
    

    I need that in windows sometimes too. I didn't test version 5 in Linux yet, so it might not work.

    0 讨论(0)
  • 2020-12-03 06:39

    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.

    0 讨论(0)
  • 2020-12-03 06:47

    Asp.Net MVC 1.0 will work with the 2.4 branch of mono but you will still need to fix the RewritePath in page load of default.aspx.cs

    0 讨论(0)
提交回复
热议问题