VS2017 - Missing .net core > 2.1 as target framework

In general, when new preview version of .NET Core 2.X appears and you are getting the error like this:

The current .NET SDK does not support targeting .NET Core 2.X

Make sure that:

  1. You have downloaded installed SDK and runtime you need. Run command dotnet --info to see what you have installed on your machine at the moment.

  2. You have checked the Use previews of the .NET Core SDK option here:

-> Tools -> Options -> Projects and Solutions -> .NET Core

Sometimes you might need to restart your Visual Studio after checking the option.

Note: it's always better to have the most recent Visual Studio version installed on your development machine (sometimes you might need a preview version - note a Download Preview link).


The user said, that my comment fixed the issue. So I'll post it as answer:

On the picture I see a lot of installed .Net Core SDKs, maybe Visual Studio has some issues with so many installed SDKs.

So move all old SDK folders (1.0 preview, 2.0, 2.1 except 2.1.402) out of this folder to a backup location and launch Visual Studio again.