[英]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.