" ..必须从WebViewPage,或WebViewPage&LT获得;&的TModel GT;"在MonoDevelop的&安培; MVC3(OS X) [英] ".. must derive from WebViewPage, or WebViewPage<TModel>" on MonoDevelop & MVC3 (OS X)

查看:161
本文介绍了" ..必须从WebViewPage,或WebViewPage&LT获得;&的TModel GT;"在MonoDevelop的&安培; MVC3(OS X)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图让一个MVC 3剃须刀项目,MonoDevelop的打算。

I'm trying to get an MVC 3 Razor project going with MonoDevelop.

我创建使用单声道2.10.9 / MonoDevelop的3.0.4.7新的ASP.net MVC 2的项目,并复制下面的DLL的从现有的基于Windows的MVC3项目Mono项目的bin目录:

I've created a new ASP.net MVC 2 project using Mono 2.10.9 / MonoDevelop 3.0.4.7, and copied the below DLL's from an existing Windows-based MVC3 project to the "bin" directory of the Mono project:

System.Web.Helpers.dll
System.Web.Razor.dll
System.Web.WebPages.Deployment.dll
System.Web.WebPages.dll
System.Web.WebPages.Razor.dll

设置的项目中使用单声道/ .NET 4的默认首页的文件已被删除,并用Index.cshtml文件替换。当我执行这个项目,我得到以下错误:

Have set the project to use Mono / .NET 4. The default Index file has been deleted and replaced with an Index.cshtml file. When I execute the project I get the below error:

The view at '~/Views/Home/Index.cshtml' must derive from WebViewPage, or WebViewPage<TModel>.

什么是奇怪的是,我已经通过这个过程之前,不得不MVC 3页的工作。这只是因为升级单声道(号称支持剃刀...?),它现在不再为我工作。我创建了previously与MVC3所有项目似乎然而,在新版本的单声道编译和功能。

What's odd is that I've been through this process before and had MVC 3 pages working. It's only since upgrading Mono (which claims to support Razor...?) that it's now no longer working for me. The projects I've created previously with MVC3 all seem to compile and function in the new Mono version however.

大部分AP preciated如果有人能指出我在哪里可以找到一些木材,这些树木中:)

Much appreciated if somebody could point out where I can find some wood amongst these trees :)

推荐答案

如果有人确实经历这一点,只是因为它驻留在视图文件夹中一直没有更新,因此其中一个引用MVC3剃刀的web.config文件组件。咄。

If anybody does experience this, it's simply because the web.config file which resides under the "Views" folder has not been updated so one which references the MVC3 Razor components. Duh.

做的最简单的办法就是复制一个来自现有项目MVC3

Easiest thing to do is copy one from an existing MVC3 project.

这篇关于&QUOT; ..必须从WebViewPage,或WebViewPage&LT获得;&的TModel GT;&QUOT;在MonoDevelop的&安培; MVC3(OS X)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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