gpt4 book ai didi

c# - .Net 标准项目 : System. Linq.Enumerable 类缺失

转载 作者:行者123 更新时间:2023-11-30 12:56:23 25 4
gpt4 key购买 nike

在 .Net Standard 1.5 项目中(1.6 从 nuget 安装)。

我无法使用 Linq 的扩展方法位于 System.Linq.Enumerable .

喜欢Where , Select LIST<string> 上的方法

我已经安装了以下软件包:

"System.Linq": "4.3.0",
"System.Linq.Expressions": "4.3.0",
"System.Linq.Queryable": "4.3.0",

更新

示例:

using System.Linq;

List<string> myList = new List();
myList = // suppose list got data

myList.Where( // Where is not available

注意

无法访问包含扩展方法的 System.Linq.Enumerable 静态类。

更新 2

{
"supports": {},
"dependencies": {
"Chance.MvvmCross.Plugins.UserInteraction": "1.1.4",
"Fody": "1.29.4",
"MethodDecorator.Fody": "0.9.0.6",
"Microsoft.NETCore.Portable.Compatibility": "1.0.1",
"MvvmCross": "4.3.0",
"MvvmCross.Platform": "4.3.0",
"NEST": "5.0.0",
"NETStandard.Library": "1.6.1",
"Newtonsoft.Json": "9.0.1",
"PropertyChanged.Fody": "1.52.1",
"System.Linq": "4.3.0",
"System.Linq.Expressions": "4.3.0",
"System.Linq.Queryable": "4.3.0",
"System.ServiceModel": "1.0.0",
"System.ServiceModel.Http": "4.3.0",
"System.ServiceModel.Security": "4.3.0"
},
"frameworks": {
"netstandard1.5": {
"imports": "portable-net45+netcore45+wp8"
}
}
}

最佳答案

我遇到了类似的问题,随着 project.lock.json 的变化“修复”了这个问题:

"System.Linq/4.3.0": {
..
"compile": {
"portable-net45+win8+wp8+wpa81/_._": {}
},
..
},

"System.Linq/4.3.0": {
..
"compile": {
"ref/netstandard1.0/System.Linq.dll": {}
},
..
},

类似的部分很少。这是解决方法而不是正确的解决方案

关于c# - .Net 标准项目 : System. Linq.Enumerable 类缺失,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41422877/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com