是否有可能使用剃刀2.0视图引擎下单? [英] Is it possible to use Razor 2.0 view engine under mono?

查看:170
本文介绍了是否有可能使用剃刀2.0视图引擎下单?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在剃刀2.0的<一个insterested href=\"http://www.asp.net/web-pages/overview/what%27s-new/top-features-in-web-pages-2#Changes_for_the_Beta_Version\">condition属性功能,所以我试图端口剃刀2.0我MVC3应用程序。我跟着此链接并成功运行我的简单的应用程序(有一个的HomeController ,一是首页行动,并在一个 *〜/查看/主页/ Index.cshtml 视图) 窗户用ASP.NET

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.

但是,当我部署我的应用程序在运行时单在Ubuntu上,它无法运行,并继续报告的错误的无法找到视图

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:

服务器中的/应用程序错误
  视图索引或它的主人没有被发现或没有视图引擎支持搜索到的位置。在以下地点进行了全面搜查:〜/查看/首页/ Index.aspx的〜/查看/主页/ Index.ascx〜/查看/共享/的Index.aspx〜/查看/共享/ Index.ascx〜/查看/首页/索引。 CSHTML〜/查看/主页/ Index.vbhtml〜/查看/共享/ Index.cshtml〜/查看/共享/ Index.vbhtml

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

我GOOGLE了这个错误,大部分文章说,这是鉴于编制的问题,所以我认为这是由单造成的无法正常使用新的Razor引擎的编译器来编译 Index.cshtml

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.

然后我打开我的应用程序回剃刀1.0和万物单下正常工作,所以它真的是单声道不能运行剃刀2.0中的问题?或者是有任何迅速解决这个问题呢?

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?

感谢

推荐答案

剃刀页面使用Mono的工作,在理论上,随着版本2.10.x系列,但你必须与它捆绑微软的组件到你的Linux机器。

Razor pages worked with Mono, in theory, with version 2.10.x series, but you had to bundle Microsoft's assemblies with it into your Linux box.

由于单声道2.11.1 ,这些组件现在是默认捆绑单,因为微软最近开碧源(上的 2012年3月)。

Since Mono 2.11.1, these assemblies are now bundled by default in Mono, because Microsoft open sourced Razor recently (on March 2012).

因此​​,如果我是你,我会尝试单声道2.11.3,看看问题是否已固定的上游。如果没有,请文件中 http://bugzilla.xamarin.com/ 一个bug与一个独立的测试用例重现它,从这里链接到错误。

Hence, if I were you I would try Mono 2.11.3 to see if the problem is already fixed upstream. If not, please file a bug in http://bugzilla.xamarin.com/ with a standalone testcase to reproduce it, and link to the bug from here.

这篇关于是否有可能使用剃刀2.0视图引擎下单?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆