C# 警告NU1701:Package';System.Linq.Queryable 4.0.1';已使用';还原;。NETFramework,版本=v4.6.1';而不是项目目标框架

C# 警告NU1701:Package';System.Linq.Queryable 4.0.1';已使用';还原;。NETFramework,版本=v4.6.1';而不是项目目标框架,c#,.net,.net-core,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:

创建新的.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. PS C:\TEMP\t>dotnet新webapi-o test2 已成功创建模板“ASP.NET核心Web API”。 正在处理创建后操作。。。 正在test2\test2.csproj上运行“dotnet还原”。。。 正在还原C:\TEMP\t\test2\test2.csproj的包。。。 C:\TEMP\t\test2\test2.csproj:警告NU1701:已使用.NETFramework,V 版本=v4.6.1'而不是项目目标框架'.NETCoreApp,版本=v2.1'。此软件包可能不完全兼容 我对你的项目很满意。 正在生成MSBuild文件C:\TEMP\t\test2\obj\test2.csproj.nuget.g.props。 正在生成MSBuild文件C:\TEMP\t\test2\obj\test2.csproj.nuget.g.targets。 C:\TEMP\t\test2\test2.csproj的还原在1.42秒内完成。 恢复成功。
删除包
System.Linq.Queryable
并为您的项目目标框架安装包。

我相信这是因为您没有安装.net v2.1,所以它警告您它使用的是新版本,而不是项目目标版本。我已经安装了.net v2.1。