If you run into an .NET Core compiling error regarding targeting .NET Core version not supported in Visual Studio like this one:

The current .NET SDK does not support targeting .NET Core 3.1. Either target .NET Core 2.1 or lower, or use a version of the .NET SDK that supports .NET Core 3.1.


First check which versions of SDKs are installed on your system and if the targeted version is missing, you can either download and install the targeted SDK manually or better update Visual Studio through the Visual Studio Installer which will also update and install the latest SDKs.


> dotnet –list-sdks


Download .NET SDKs for Visual Studio
https://dotnet.microsoft.com/download/visual-studio-sdks


Update and install missing SDKs with the Visual Studio Installer.



Finally you can check with the following command your .NET environment on your system to see all installed versions of .NET SDKs and .NET runtimes.


< dotnet –info


In order to enable new installed previews of the .NET Core SDK in Visual Studio, you have to check the following under Tools -> Options -> Project and Solutions -> .NET Core


At creating a new project you can now select the new Target Framework.



Links

Download .NET SDKs for Visual Studio
https://dotnet.microsoft.com/download/visual-studio-sdks

Download .NET
https://dotnet.microsoft.com/download/dotnet

.NET Core
https://en.wikipedia.org/wiki/.NET_Core