Questieme
Questieme

Reputation: 993

Visual Studio can not find the latest installed .NET SDK

I downloaded a project from Github with its Target Framework netcoreapp3.1. After building it, an error stating that

The current .NET SDK does not support targeting .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.

Hence, I downloaded and installed dotnet-sdk-3.1.300-win-x64 and now my SDK list is the following:

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\.

However, Visual Studio still outputs the same error in regards to the .NET SDK's version. If I go to the project's Properties, all previous 4 SDK versions appear, except for the 3.1 one. enter image description here Is there any workaround fix for this or shall I just reinstall Visual Studio?

Upvotes: 2

Views: 1704

Answers (2)

RickAndMSFT
RickAndMSFT

Reputation: 22770

Visual Studio won't be able to find the latest SDK if it's a different bit size than the first SDK installation. To fix that case see Windows or Visual Studio can't find the latest installed .NET SDK

Upvotes: 0

magicandre1981
magicandre1981

Reputation: 28766

To target .Net Core 3.1 with the SDK 3.1.300 you Visual Studio 2019 Update 6 (16.6):

enter image description here

So, run Visual Studio Installer and install the offered 16.6 update.

Upvotes: 1

Related Questions