类型'防爆pression<>'在未引用的程序定义 [英] The type 'Expression<>' is defined in an assembly that is not referenced

查看:544
本文介绍了类型'防爆pression<>'在未引用的程序定义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在ASP.NET MVC框架4.5.2

In ASP.NET MVC 4.5.2 Framework.

后键入

@Html.LabelFor()
or 
@Html.EditorFor()

针对

我收到错误:类型'防爆pression<>'在未referenced.You必须在引用程序集System.Core程序添加组件定义,版本= 4.0.0.0文化=中性公钥= b77a5c561934e089'。

我已经加入装配参考System.Core.dll,版本4.0.0.0,运行时版本v4.0.30319。而且我在web.config中做

I have added assembly reference System.Core.dll, Version 4.0.0.0, Runtime Version v4.0.30319. and also i did in web.config

推荐答案

我在同样的问题,因为你跑,虽然要晚得多。问题是,我是不是能够访问剃刀视图(.cshtml)因为我得到了一个错误,说明我有一个缺失集引用,即 System.Web.Mvc ,即使它是在项目中引用。经过调查,我已经注意到了,安装的NuGet版本是5.2.3,而项目所需5.2.0。解决的办法是降级了MVC版本

I have run in the same issue as you, albeit much later. The issue was that I was not able to access Razor views (.cshtml) as I was getting an error stating that I had a missing assembly reference, namely System.Web.Mvc, even though it was in the project references. After investigation, I have noticed that the installed NuGet version was 5.2.3, while the project required 5.2.0. The solution is to downgrade the MVC version.


  1. 转到项目 - >的NuGet包管理器。

  2. 搜索MVC;这将是第一个结果。

  3. 接下来是从的细节下拉列表中选择降级
    的NuGet包并提交。

确认所有的对话框,你准备好了。

Confirm all the dialogs and you are ready to go.

这篇关于类型'防爆pression<>'在未引用的程序定义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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