在.Net Standard 1.5項目(1.6從nuget安裝)。.Net標準項目:缺少System.Linq.Enumerable類
我不能使用駐留在System.Linq.Enumerable
中的Linq
的擴展方法。
像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"
}
}
}
您是否有小代碼示例?在黑暗中拍攝了幾張照片:你是否檢查過庫是否被引用,你是否用「using」導入了它們,並且你是在List對象上調用它們,還是試圖在List類上調用它們? – prof1990
@ prof1990我想通過List的對象訪問System.Linq.Enumerable類中的擴展方法。我已經檢查過,System.Linq.Enumerable類不可用,但有趣的是System.Linq包已安裝。然後,擴展方法需要哪個包。 –
顯示完整的'project.json' – haim770