迁移到MVC3

时间:2012-07-30 18:12:12

标签: .net asp.net-mvc-3 asp.net-mvc-2 spark-view-engine

我尝试从MVC2迁移到MVC3。我使用Spark视图引擎。更改引用后,我的Spark页面基类只有2个错误:

The type 'System.Web.Mvc.IView' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null'. C:\Dev\main\app\Web\Html\SparkPageBase.cs


The type 'System.Web.Mvc.IViewDataContainer' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null'.    C:\Dev\main\app\Web\Html\SparkPageBase.cs

我如何解决这个问题?

2 个答案:

答案 0 :(得分:3)

尝试下载并使用Spark View Engine for MVC3。

Spark View Engine for MVC3

答案 1 :(得分:1)

在修改web.config以使System.Web.Mvc

具有以下版本后,查看它是否有效
<dependentAssembly>
    <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
    <bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="3.0.0.0" />
  </dependentAssembly>