您必须添加对程序集 mscorlib 的引用,版本 = 4.0.0 [英] You must add a reference to assembly mscorlib, version=4.0.0

查看:285
本文介绍了您必须添加对程序集 mscorlib 的引用,版本 = 4.0.0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在将 Web 项目从 RC1 迁移到 RC2 时遇到了一些问题.当我切换时,我在整个项目中遇到了一堆这样的错误.

I'm having some trouble migrating a web project from RC1 to RC2. When I switched, I'm getting a bunch of these errors throughout the project.

类型Func<,>"是在未引用的程序集中定义的.您必须添加对程序集 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' 的引用

The type 'Func<,>' is defined in an assembly that is not referenced. You must add a reference to assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'

看起来所有的 linq 函数和 lambda 表达式都不起作用.

Looks like all of the linq functions and lambda expressions are not working.

这是我的 project.json 文件的样子:

This is what my project.json file looks like:

  "frameworks": {
    "netcoreapp1.0": {
      "dependencies": {
        "System.Linq": "4.1.0-rc2-24027"
      },
      "imports": [ "net451", "portable-net45+win8" ]
    }
  },
  "dependencies": {
    "NETStandard.Library": "1.5.0-rc2-24027",
    "Microsoft.EntityFrameworkCore": "1.0.0-rc2-final",
    "Microsoft.EntityFrameworkCore.SqlServer": "1.0.0-rc2-final",
    "System.ComponentModel.Annotations": "4.1.0-*"
  }

知道这是什么意思吗?我试过运行 dotnet restore,没有帮助.

Any ideas what this means? I've tried running dotnet restore, did not help.

推荐答案

我遇到了同样的问题,将以下包添加到我的 project.json 依赖项为我修复了它:

I had the same issue and adding the following package to my project.json dependencies fixed it for me:

"Microsoft.NETCore.Portable.Compatibility": "1.0.1-rc2-24027",

此软件包可与基于 mscorlib 的 PCL 兼容.

This package enables compatibility with mscorlib-based PCLs.

这篇关于您必须添加对程序集 mscorlib 的引用,版本 = 4.0.0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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