简体   繁体   English

如何将项目从System.runtime 4.0.10.0更新到4.0.20.0

[英]How can I update my project from System.runtime 4.0.10.0 to 4.0.20.0

I get this error when I build my project: 构建项目时出现此错误:

Severity Code Description Project File Line Error CS1705 Assembly 'EntityFramework.Core' with identity 'EntityFramework.Core, Version=7.0.0.0, Culture=neutral, PublicKeyToken=null' uses 'System.Runtime, Version=4.0.20.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' which has a higher version than referenced assembly 'System.Runtime' with identity 'System.Runtime, Version=4.0.10.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' TaaS.DataAccess..NET Platform C:_REPOSITORIES\\taas-application\\TaaS-WebApplication\\TaaS.DataAccess\\TaaSContext.cs 8 严重性代码说明项目文件行错误CS1705身份为'EntityFramework.Core,版本= 7.0.0.0,区域性=中性,PublicKeyToken =空的程序集'EntityFramework.Core'使用'System.Runtime,版本= 4.0.20.0,区域性=中性,PublicKeyToken = b03f5f7f11d50a3a'的版本高于引用程序集'System.Runtime',标识为'System.Runtime,版本= 4.0.10.0,Culture = neutral,PublicKeyToken = b03f5f7f11d50a3a'TaaS.DataAccess..NET平台C:_REPOSITORIES \\ taas-应用程序\\ TaaS-WebApplication \\ TaaS.DataAccess \\ TaaSContext.cs 8

How can I update from System.runtime 4.0.10.0 to 4.0.20.0 ? 如何从System.runtime 4.0.10.0更新到4.0.20.0?

That is my project.json file: 那是我的project.json文件:

{
  "version": "1.0.0-*",
  "description": "TaaS.DataAccess Class Library",
  "authors": [ "LisaTatum" ],
  "tags": [ "" ],
  "projectUrl": "",
  "licenseUrl": "",

  "dependencies": {
    "System.Collections": "4.0.10-beta-23019",
    "System.Linq": "4.0.0-beta-23019",
    "System.Threading": "4.0.10-beta-23019",
    "System.Runtime": "4.0.10-beta-23019",
    "Microsoft.CSharp": "4.0.0-beta-23019",
    "EntityFramework.SqlServer": "7.0.0-beta7",
    "EntityFramework.Commands": "7.0.0-beta7",
    "EntityFramework.Relational": "7.0.0-beta5"


  },


  "frameworks": {
    "dotnet": { }
  }
}

I went to the nuget package manager and searched for updateable packages and there was System.Runtime 4.0.20.0. 我去了nuget软件包管理器并搜索了可更新的软件包,然后找到了System.Runtime 4.0.20.0。 I updated it and from now on everything is broken thanks to Microsoft. 我对其进行了更新,从此以后,一切都归功于Microsoft。 I know its beta but that should not happen: 我知道它的测试版,但那不会发生:

Severity    Code    Description Project File    Line
Warning     Dependency specified was System.Runtime >= 4.0.20 but ended up with System.Runtime 4.0.10-beta-23019.   TaaS.DataAccess C:\_REPOSITORIES\taas-application\TaaS-WebApplication\TaaS.DataAccess\project.json  13

I believe if you update your project.json as follows it will solve the error: 我相信,如果您按照以下方式更新project.json,它将解决错误:

{
  "version": "1.0.0-*",
  "description": "TaaS.DataAccess Class Library",
  "authors": [ "LisaTatum" ],
  "tags": [ "" ],
  "projectUrl": "",
  "licenseUrl": "",

  "dependencies": {

    "EntityFramework.SqlServer": "7.0.0-beta7",
    "EntityFramework.Commands": "7.0.0-beta7"

    }

  "frameworks": {
    "dnx451": { },
    "dnxcore50" : {
      "dependencies": {
        "System.Collections": "4.0.11-beta-23225",
        "System.Data.Common": "4.0.1-beta-23225",
        "System.Linq": "4.0.1-beta-23225",
        "System.Runtime": "4.0.21-beta-23225",
        "Microsoft.CSharp": "4.0.1-beta-23225"
       }
    }
  }
}

note that in early beta versions of tooling class library projects were created with the target "dotnet" as you had it but if you create a class library project with the latest beta7 tooling it uses dnx451 and dnxcore50 so that dependencies can be set independently for each framework. 请注意,在早期的工具版本Beta版中,类库项目是使用目标“ dotnet”创建的,但是如果您使用最新的beta7工具创建类库项目,则它使用dnx451和dnxcore50,因此可以为每个类独立设置依赖项框架。 The ones labelled beta7 go in the main dependencies because they are needed by both dnx451 and dnxcore50. 标有beta7的那些文件属于主要依赖项,因为dnx451和dnxcore50都需要它们。

Those dependencies which are not labelled as beta7 are only needed for dnxcore50 so I moved them into the dnxcore50 dependencies and also corrected the versions to correspond to beta7 (there is a correspondence even though they are not named beta7). 那些未标记为beta7的依赖项仅对于dnxcore50才需要,因此我将它们移到了dnxcore50依赖项中,并更正了对应于beta7的版本(即使它们没有命名为beta7,也存在对应关系)。 I also removed a couple of references that I think are not needed and perhaps no longer exist as packages for beta7 我还删除了一些我认为不需要的参考,也许不再作为beta7的软件包存在。

If you need to roll the upgrade back, you can do so by typing the following into the Package Manager Console. 如果需要回滚升级,可以通过在Package Manager Console中键入以下内容来进行。

Uninstall-Package System.Runtime -Force

and then 接着

Install-Package System.Runtime -Version 4.0.10-beta-23019

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 .NET Framework:如何更新 System.Runtime? - .NET Framework: How to update System.Runtime? 网站升级到MVC5.1后,Server 2012r2上缺少System.Runtime 4.0.10.0 - System.Runtime 4.0.10.0 missing on Server 2012r2 after website upgrade to MVC5.1 我无法在.net 4.7项目中使用System.Runtime 4.3.0 - I can't use the System.Runtime 4.3.0 in a .net 4.7 project 为什么我的PCL无法使用System.Runtime? - Why can't my PCL use System.Runtime? 是否可以在Xamarin项目中更改System.Runtime的版本? - Is it possible to change the version of System.Runtime in a Xamarin project? Msbuild无法使用间接引用System.Runtime来构建网站项目 - Msbuild fails building website project with an indirect reference to System.Runtime 无法在Visual Studio WebApi项目上加载System.runtime dll - Failure to load System.runtime dll on Visual studio WebApi project 为什么Windows 8.1程序包中不能使用System.Runtime? - Why can't System.Runtime be used in Windows 8.1 packages? 如何解决“System.Runtime”和“netstandard”中都存在“AssemblyCompanyAttribute”类型? - How to resolve The type 'AssemblyCompanyAttribute' exists in both 'System.Runtime,' and 'netstandard'? 无法加载文件或程序集System.Runtime - Cannot load file or assembly System.Runtime
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM