I was insterested in Razor 2.0's condition attributes feature, so I tried to port Razor 2.0 to my MVC3 apps. I followed this link and successfully run my simple app (with one HomeController
, one Index
action and one *~/Views/Home/Index.cshtml view) on Windows with ASP.NET.
But when I deployed my app on mono runtime on Ubuntu, it fails to run and continues to report an error of Cannot find view:
Server Error in '/' Application The view 'Index' or its master was not found or no view engine supports the searched locations. The following locations were searched: ~/Views/Home/Index.aspx ~/Views/Home/Index.ascx ~/Views/Shared/Index.aspx ~/Views/Shared/Index.ascx ~/Views/Home/Index.cshtml ~/Views/Home/Index.vbhtml ~/Views/Shared/Index.cshtml ~/Views/Shared/Index.vbhtml
I googled for this error, most of the articles says it is a problem of view compiling, so I thought it is caused by mono cannot properly use the new Razor engine's compiler to compile Index.cshtml.
I then switched my app back to Razor 1.0 and everythings works fine under mono, so is it really a problem that mono cannot run Razor 2.0? or is there any quick solution to this problem?
Thanks