mvccontribで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 dynamicに設定するだけで機能し、再度失敗するため、basePageTypeをデフォルトに変更し、次のバージョンMvcContrib.FluentHtml.ModelWebViewPage<dynamic> and MvcContrib.FluentHtml.ModelWebViewPage<MyModel>
で修正されるまで使用します。MvcContrib/MVC 4