2

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?

5
  • Thank you! My VS is indeed older than 16.6 - it's 16.2.2. I will update it and see if that works! Commented May 24, 2020 at 14:48
  • 1
    have you tried the last 16.6 version? Does it solve the issue? Commented May 25, 2020 at 13:59
  • @magicandre1981 Sorry for the delayed answer! Yes, it did solve the issue, indeed! Thank you very much! Commented May 25, 2020 at 14:09
  • ok, I posted it as answer, so that you can accept the reply as answer to "close" the question. Commented May 25, 2020 at 14:19
  • See stackoverflow.com/questions/67049414/… which is the MS supported answer Commented Apr 12, 2021 at 17:57

2 Answers 2

1

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.

Sign up to request clarification or add additional context in comments.

Comments

0

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

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.