2012-07-30 109 views
1

我試圖從MVC2遷移到MVC3。我使用Spark視圖引擎。更改引用後,我的Spark頁面基類中只有2個錯誤:遷移到MVC3

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 

我該如何解決此問題?

回答

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> 
看看它後,你的工作