我在asp.net vNext类库中使用了linq表达式。编辑器中没有显示错误,但是当我尝试构建时,我看到以下消息:
Could not find an implementation of the query pattern for source type 'IEnumerable<T>'. 'Select' not found. Are you missing a reference to 'System.Core.dll' or a using directive for 'System.Linq'? FitLog.Domain.ASP.NET Core 5.0
我确实有System.Linq的using语句,所以我不确定发生了什么。
更新
这是我的project.json:
{
"version": "1.0.0-*",
"dependencies": {
},
"frameworks" : {
"aspnet50" : {
"dependencies": {
}
},
"aspnetcore50" : {
"dependencies": {
"System.Runtime": "4.0.20-*"
}
}
}
}
答案 0 :(得分:6)
对于aspnetcore50
目标,您需要为System.Linq
添加依赖项(您会在project.json
文件的智能感知中看到它。