2014-01-17 58 views
0

我正在MVC4中开发应用程序,现在我添加了新软件包“mvcinstalled.mvc3”和“securityGuard”。执行后,我得到了一个错误。我知道这两个软件包都与剃须刀版本V1兼容,不适用于V2。任何人都可以建议任何解决方案如何从Razor V2迁移到V1或将完整的应用程序迁移到MVC3?从MVC4迁移到MVC3或将Razor版本V2更改为V1

[A]System.Web.WebPages.Razor.Configuration.HostSection cannot be cast to  
[B]System.Web.WebPages.Razor.Configuration.HostSection. Type A originates from 
'System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, 
PublicKeyToken=31bf3856ad364e35' in the context 'Default' at location 
C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.WebPages.Razor\v4.0_1.0.0. 
0__31bf3856 
ad364e35\System.Web.WebPages.Razor.dll'. Type B originates from 
'System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, 
PublicKeyToken=31bf3856ad364e35' in the context 'Default' at location 
'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.WebPages.Razor\v4.0_2.0.0.0 
__31bf3856ad364e35\System.Web.WebPages.Razor.dll'. 
Description: An unhandled exception occurred during the execution of the current web 
request. Please review the stack trace for more information about the error and where 
it originated in the code. 

Exception Details: System.InvalidCastException: 
[A]System.Web.WebPages.Razor.Configuration.HostSection cannot be cast to 
[B]System.Web.WebPages.Razor.Configuration.HostSection. Type A originates from 
'System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, 
PublicKeyToken=31bf3856ad364e35' in the context 'Default' at location 
'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.WebPages.Razor\v4.0_1.0.0.0 
__31bf3856ad364e35\System.Web.WebPages.Razor.dll'. Type B originates from 
'System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, 
PublicKeyToken=31bf3856ad364e35' in the context 'Default' at location  
'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.WebPages.Razor\v4.0_2.0.0.0 
__31bf3856ad364e35\System.Web.WebPages.Razor.dll'. 
+0

有人有想法吗? –

回答

0

我解决不了这个问题,我开始开发在MVC4现在的一切,而不是移动到MVC3。