且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

无法使用.Net Core 2.1在Visual Studio 2017中创建.Net项目

更新时间:2021-12-09 04:35:01

嗨Santoshthakkar,

欢迎来到MSDN论坛,

您什么时候遇到此错误?打开一个新项目或构建或发布它?您选择了哪个蓝图模板?

我试图在你身边重新发出问题,下面我展示了.net核心和SDK的版本。

然后我创建并构建项目,一切都很好。也许你可以分享关于你的问题的详细步骤。

一般来说,错误"当前的.NET SDK不支持以.NET Core 2.1为目标。可以是.NET Core 1.1或更低版本,也可以使用支持.NET Core的.NET SDK版本
2.1。
"表示MS已与安装的多个SDK混淆。请查看
使用.NET Core SDK选项的预览: - >工具 - &gt ;选项 - >项目和解决方案 - > .NET核心说明:有时您可能需要在检查选项后重新启动Visual Studio。

In general, error "The current .NET SDK does not support targeting .NET Core 2.1. Either target .NET Core 1.1 or lower, or use a version of the .NET SDK that supports .NET Core 2.1." indicates that MS has confused with multiple SDKs installed. could you please check the Use previews of the .NET Core SDK option here:-> Tools -> Options -> Projects and Solutions -> .NET Core note: sometimes you might need to restart your Visual Studio after checking the option.

如果没有,请运行命令行: donet -info
以查看您当前在计算机上安装的内容。然后将此文件夹中的所有旧SDK文件夹(1.0预览,2.0,2.1除2.1.402)删除到备份位置并启动Visual Studio再次。

If not, please run command line: donet –info to see what you have installed on your machine at the moment. Then delete all old SDK folders (1.0 preview, 2.0, 2.1 except 2.1.402) out of this folder to a backup location and launch Visual Studio again.

更多,我发现一个类似的线程,引入其他其他解决方案可能值得尝试:

https://***.com/questions/49171623/the-current-net-sdk-does -not-support-targeting-net-core-2-1-target-net-core

或者您可以再次分享我们的演示来重新发布此问题,如有必要,请将其上传到https://onedrive.live.com/。

任何反馈都将被排除。

***的问候

可能