[英]The current .NET SDK does not support targeting .NET Core 2.2. Either target .NET Core 2.1 or lower
Hi I am using VS 2017 Commuity.嗨,我正在使用 VS 2017 社区。 When I build I am getting the this error I have also installed latest sdk , even I am having same issue.
当我构建时,我收到此错误我也安装了最新的 sdk ,即使我遇到了同样的问题。 Kindly help
请帮忙
It's very important and not necessarily obvious, but you'll want to make sure that you explicitly target the 2.2.1xx version when running Visual Studio 2017 as the build versions differ between Visual Studio 2017 and 2019 :这非常重要且不一定显而易见,但您需要确保在运行 Visual Studio 2017 时明确定位 2.2.1xx 版本,因为 Visual Studio 2017 和 2019 之间的构建版本不同:
It's very likely that you installed the latest version, but not necessarily the one with support for Visual Studio 2017. You can find the appropriate version for 2017/2019 from the .NET Core Download page here that demonstrates the distinction between the two SDKs and which version of Visual Studio is supported for each:您很可能安装了最新版本,但不一定是支持 Visual Studio 2017的版本。您可以在此处的 .NET Core 下载页面中找到适用于 2017/2019 的版本,该页面演示了两种 SDK 之间的区别以及哪些每个版本都支持 Visual Studio 版本:
In my case, the following fixed the issue:就我而言,以下解决了该问题:
Find out the latest SDK installed by issue the following command in CMD:通过在 CMD 中发出以下命令找出安装的最新 SDK:
dotnet --list-sdks
Then in your project's global.json file, update the version to the latest version found from previous command:然后在您项目的 global.json 文件中,将版本更新为从上一个命令中找到的最新版本:
{
"sdk": {
"version": "3.1.302"
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.