新足迹

 找回密码
 注册

精华好帖回顾

· 小D的中学新生生活 - (本贴最后一次更新,7年级新生生活大结局689楼) (2011-2-6) 缓缓 · 自己动手装修Kitchen, Pantry和Laundry的记录--持续更新中 (2020-9-14) jz1215
· 短登作业之二------墨尔本被盗篇! (2005-2-25) suxiaomei · 【直播结束】来和我一起见证被妈妈遗弃的小鸡的出生吗?(第14页新增坚强光屁屁照!18+) (2010-11-16) 七朵花
Advertisement
Advertisement
查看: 1470|回复: 2

Issues when converting to MVC4 [复制链接]

2010年度奖章获得者

发表于 2012-3-2 11:49 |显示全部楼层
此文章由 dalaohu 原创或转贴,不代表本站立场和观点,版权归 oursteps.com.au 和作者 dalaohu 所有!转贴必须注明作者、出处和本声明,并保持内容完整
I keep getting this error when converting an existing MVC3 proj to MVC4
Any one run into the same issue and resolutions?


[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'.
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'.
足迹 Reader is phenomenal. If you never used, you never lived 火速下载
Advertisement
Advertisement

发表于 2012-3-2 12:21 |显示全部楼层
此文章由 典 原创或转贴,不代表本站立场和观点,版权归 oursteps.com.au 和作者 典 所有!转贴必须注明作者、出处和本声明,并保持内容完整
Referenc饿不对?
我见到过这个,你要不要试一下直接reference到一个dll文件上
...your project location\\\\AspNetWebPagesCore.2.0.10906.0\lib\net40\System.Web.Razor.dll

[ 本帖最后由 典 于 2012-3-2 11:25 编辑 ]

2010年度奖章获得者

发表于 2012-3-2 12:27 |显示全部楼层
此文章由 dalaohu 原创或转贴,不代表本站立场和观点,版权归 oursteps.com.au 和作者 dalaohu 所有!转贴必须注明作者、出处和本声明,并保持内容完整
found the issue,

I forgot up update the razor settings in Views/web.config!

发表回复

您需要登录后才可以回帖 登录 | 注册

本版积分规则

Advertisement
Advertisement
返回顶部