警告NU1701:Package' System.Linq.Queryable 4.0.1'使用' .NETFramework,V ersion = v4.6.1'进行了恢复。而不是项目目标框架

时间:2018-06-15 18:10:03

标签: c# .net .net-core

创建新的.net核心项目时,我总是收到以下警告。如何解决这个问题?

PS C:\TEMP\t> dotnet new webapi -o test2
The template "ASP.NET Core Web API" was created successfully.

Processing post-creation actions...
Running 'dotnet restore' on test2\test2.csproj...
  Restoring packages for C:\TEMP\t\test2\test2.csproj...
C:\TEMP\t\test2\test2.csproj : warning NU1701: Package 'System.Linq.Queryable 4.0.1' was restored using '.NETFramework,V
ersion=v4.6.1' instead of the project target framework '.NETCoreApp,Version=v2.1'. This package may not be fully compati
ble with your project.
  Generating MSBuild file C:\TEMP\t\test2\obj\test2.csproj.nuget.g.props.
  Generating MSBuild file C:\TEMP\t\test2\obj\test2.csproj.nuget.g.targets.
  Restore completed in 1.42 sec for C:\TEMP\t\test2\test2.csproj.

Restore succeeded.

1 个答案:

答案 0 :(得分:0)

删除包System.Linq.Queryable并为您的项目目标框架安装包。

相关问题