加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

c# – System.Runtime.Extensions需要更高版本的System.Runtime

发布时间:2020-12-15 22:19:31 所属栏目:百科 来源:网络整理
导读:我正在Visual Studio中开发一个新的“类库(NuGet包)”项目.一切都很顺利,直到有一天它开始引发有关System.Runtime.Extensions程序集的错误: Assembly 'System.Runtime.Extensions' with identity 'System.Runtime.Extensions,Version=4.0.10.0,Culture=neut
我正在Visual Studio中开发一个新的“类库(NuGet包)”项目.一切都很顺利,直到有一天它开始引发有关System.Runtime.Extensions程序集的错误:

Assembly 'System.Runtime.Extensions' with identity 'System.Runtime.Extensions,Version=4.0.10.0,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a' uses 'System.Runtime,Version=4.0.20.0,PublicKeyToken=b03f5f7f11d50a3a' which has a higher
version than referenced assembly 'System.Runtime' with identity 'System.Runtime,PublicKeyToken=b03f5f7f11d50a3a'

我检查了on NuGet,看起来确实如此,System.Runtime.Extensions要求System.Runtime至少为4.0.20.

我尝试更改project.json的“dependencies”部分中的以下行:

"System.Runtime": "4.0.10-beta-23019",

到“4.0.20-beta-23019”,但它告诉我“System.IO和System.Runtime中都存在类型IOException.”

我该怎么做才能解决这个问题?

谢谢.

编辑:刚刚尝试了一个新的包装项目,它似乎也失败了,所以有些事情发生了.

解决方法

尝试将其仅添加到.NET Core目标框架:

{
    "dependencies": { },"frameworks": {
        "dotnet": {
            "dependencies": {
                "Microsoft.CSharp": "4.0.0","System.Collections": "4.0.10","System.Linq": "4.0.0","System.Runtime.Extensions": "4.0.10","System.Threading": "4.0.10"
            }
        }
    }
}

其中dnxcore50是.NET Core目标框架.也可以是dotnet.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读