asp.net mvc 2 Could not load type 'System.Web.Mvc.ViewPage<dynamic>'错误解决办法
2011-01-05 17:11 Lecone.JY.HU 阅读(881) 评论(0) 编辑 收藏 举报今天把asp.net mvc 2 (.net 4.0)网站部署到服务器(Win 2003)时出现了Could not load type 'System.Web.Mvc.ViewPage<dynamic>'这样的问题。经过一番的查找后终于找到了解决方案。在web.config文件中的system.web节点下pages节点中添加pageParserFilterType、pageBaseType、userControlBaseType,如下:
代码
<system.web>
<pages pageParserFilterType="System.Web.Mvc.ViewTypeParserFilter, System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
pageBaseType="System.Web.Mvc.ViewPage, System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
userControlBaseType="System.Web.Mvc.ViewUserControl, System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
</pages>
</system.web>
<pages pageParserFilterType="System.Web.Mvc.ViewTypeParserFilter, System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
pageBaseType="System.Web.Mvc.ViewPage, System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
userControlBaseType="System.Web.Mvc.ViewUserControl, System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
</pages>
</system.web>