我只是试图用mvccont肋骨获得工作mvc4,我在web.config中设置了基本页面(就像我在mvc3项目中所做的那样)
<pages pageBaseType="MvcContrib.FluentHtml.ModelWebViewPage">但是在运行时,我得到了一个错误:
Server Error in '/' Application.
--------------------------------------------------------------------------------
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: CS0305: Using the generic type 'MvcContrib.FluentHtml.ModelWebViewPage<T>' requires 1 type arguments
Source Error:
Line 32:
Line 33:
Line 34: public class _Page_Views_Home_Index_cshtml : MvcContrib.FluentHtml.ModelWebViewPage {
Line 35:
Line 36: #line hidden
Source File: c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\17698293\b6166ab6\App_Web_index.cshtml.a8d08dba.e7moq-gi.0.cs Line: 34 也许有人能帮上忙?有什么想法吗?
更新:
看起来问题是:
如果我设置了自定义基类<pages pageBaseType="MvcContrib.FluentHtml.ModelWebViewPage">,而且如果视图上没有任何自定义模型,在这种情况下,我将得到该错误。因此,在这种情况下,我只需要将视图中的模型设置为@model,它就可以工作,而不是再次失败,所以我只需将basePageType更改为其默认值,并使用MvcContrib.FluentHtml.ModelWebViewPage<dynamic> and MvcContrib.FluentHtml.ModelWebViewPage<MyModel>,直到在下一个MvcContrib/MVC 4版本中修复为止。
发布于 2011-11-17 22:16:31
问题是MvcContrib.FluentHtml.ModelWebViewPage不存在,只有MvcContrib.FluentHtml.ModelWebViewPage<T>。如果您没有模型类,则可以执行MvcContrib.FluentHtml.ModelWebViewPage<dynamic>。
尽管如此,我不知道MVC控制将与MVC4一起工作,通常需要根据新的MVC版本重新编译。。。。
https://stackoverflow.com/questions/8165835
复制相似问题