我尝试从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
我如何解决这个问题?
答案 0 :(得分:3)
尝试下载并使用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>