ASP.NET MVC 4 Beta版打破开发商preVIEW项目 [英] ASP.NET MVC 4 Beta Breaks Developer Preview Projects

查看:134
本文介绍了ASP.NET MVC 4 Beta版打破开发商preVIEW项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

升级到我的ASP.NET MVC 4开发preVIEW组件到最新的MVC 4测试版后,将出现以下异常为我的MVC 4个项目:

After upgrading to my ASP.NET MVC 4 Developer Preview assemblies to the latest MVC 4 beta, the following exception occurs for my MVC 4 projects:

Could not load type 'System.Web.WebPages.DisplayModes' from assembly
'System.Web.WebPages, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35'.

...

Exception Details: System.TypeLoadException: Could not load type
'System.Web.WebPages.DisplayModes' from assembly 'System.Web.WebPages,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.

我该如何解决这个问题?

How do I fix this?

更新:我安装了新的MVC 4 Beta版的NuGet包,增加最合适的组件,但现在我得到的编译缺少DisplayModes错误:

Update: I installed the new MVC 4 Beta NuGet package, which added most of the right assemblies, but now I get the missing DisplayModes error on compile:

The name 'DisplayModes' does not exist in the current context.

有关在下面的一段code的的Global.asax.cs

For the following piece of code in Global.asax.cs:

DisplayModes.Modes.Insert(0, new DefaultDisplayMode("iPhone") { ... });

2日更新:解决

推荐答案

DisplayModes 语法已更改为:

DisplayModeProvider.Instance.Modes.Insert(0, new DefaultDisplayMode("iPhone")
    {
    ...
    });

这篇关于ASP.NET MVC 4 Beta版打破开发商preVIEW项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆