简体   繁体   English

Visual Studio 找不到最新安装的 .NET SDK

[英]Visual Studio can not find the latest installed .NET SDK

I downloaded a project from Github with its Target Framework netcoreapp3.1 .我从 Github 下载了一个项目及其目标框架netcoreapp3.1 After building it, an error stating that构建后,出现错误说明

The current .NET SDK does not support targeting .NET Core 3.1.当前的 .NET SDK 不支持针对 .NET Core 3.1。 Either target .NET Core 2.2 or lower, or use a version of the .NET SDK that supports .NET Core 3.1.要么针对 .NET Core 2.2 或更低版本,要么使用支持 Z303CB0EF9EDB9082AZD61BBBE5825D972AZ SDK 的版本。

Hence, I downloaded and installed dotnet-sdk-3.1.300-win-x64 and now my SDK list is the following:因此,我下载并安装了dotnet-sdk-3.1.300-win-x64 ,现在我的 SDK 列表如下:

dotnet --list-sdks
2.1.602 [C:\Program Files\dotnet\sdk]
2.1.700 [C:\Program Files\dotnet\sdk]
2.1.801 [C:\Program Files\dotnet\sdk]
2.2.401 [C:\Program Files\dotnet\sdk]
3.1.300 [C:\Program Files\dotnet\sdk]

In the environment variables, I added a new variable for the Path User variables pointing to C:\Program Files\dotnet\ .在环境变量中,我为指向C:\Program Files\dotnet\的路径用户变量添加了一个新变量。

However, Visual Studio still outputs the same error in regards to the .NET SDK's version.但是,对于 .NET SDK 的版本,Visual Studio 仍然输出相同的错误。 If I go to the project's Properties, all previous 4 SDK versions appear, except for the 3.1 one.如果我 go 到项目的属性,所有以前的 4 SDK 版本都会出现,除了 3.1 一个。 在此处输入图像描述 Is there any workaround fix for this or shall I just reinstall Visual Studio?是否有任何解决方法可以解决这个问题,还是我应该重新安装 Visual Studio?

To target.Net Core 3.1 with the SDK 3.1.300 you Visual Studio 2019 Update 6 (16.6):要使用 SDK 3.1.300 定位.Net Core 3.1,请使用 Visual Studio 2019 Update 6 (16.6):

在此处输入图像描述

So, run Visual Studio Installer and install the offered 16.6 update.因此,运行Visual Studio 安装程序并安装提供的 16.6 更新。

Visual Studio won't be able to find the latest SDK if it's a different bit size than the first SDK installation.如果最新的 SDK 与第一个 SDK 安装的位大小不同,Visual Studio 将无法找到它。 To fix that case see Windows or Visual Studio can't find the latest installed .NET SDK要解决这种情况,请参阅Windows 或 Visual Studio 找不到最新安装的 .NET SDK

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Visual Studio找不到.NET Core SDK? - Visual Studio can't find .NET Core SDK? Unity 在 Visual Studio 中找不到与 Nuget 一起安装的 package - Unity can't find package installed with Nuget in Visual Studio Visual Studio Code 找不到 .NET SDK - Visual Studio Code can't locate .NET SDK Visual Studio Code 逻辑应用程序出错? “您必须安装 .NET Core SDK” - Error from Visual Studio Code Logic Apps? "you must have the .NET Core SDK installed" 无法在 Windows 11 上找到任何已安装的 .NET Core SDK(visual Studio 代码) - Not possible to find any installed .NET Core SDKs on Windows 11 (visual Studio code) 在.NET 3.5和Visual Studio 2008中找不到HttpContext - Can't find HttpContext in .NET 3.5 and Visual Studio 2008 .net 使用 Visual Studio 进行远程调试 — “找不到路径。” - .net Remote Debugging with Visual Studio — “Can't find path.” 如何修复 Visual Studio 2019 中的错误“windows sdk 未正确安装”? - How to fix the error "windows sdk is not installed correctly" in Visual Studio 2019? 已安装Azure SDK,但Visual Studio 2012未看到它 - Azure SDK is installed but Visual Studio 2012 doesn't see it 我可以在没有安装Visual Studio的Windows服务器上构建.NET Core应用程序吗? - Can I build .NET Core applications on a Windows server without Visual Studio installed?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM