Ya Wang
Ya Wang

Reputation: 1808

VS2017 - Missing .net core > 2.1 as target framework

Solution found! Took awhile, installed ALL sdks, and ALL runtimes then reinstalled latest version I wanted!

Goal, Have netcore 2.1 or greater as a dropdown option in visual studio. I've looked at possible duplicates questions already!

Details

After the last update of visual studio 15.7 to 15.8.4 .net core 2.1 or greater has disappeared from the target framework list.

I looked at other solutions as seen below. They were not helpful as I installed every version under the sun. See below screens.

Checked below for solutions (I already looked for solutions here!): VS2017 : Target framework drop down does not show .NET Core 2.1 option

The current .NET SDK does not support targeting .NET Core 2.1. target .NET Core 2.0 or lower or use a vs of the .NET SDK that support NET Core 2.1

Referenced screens: enter image description here enter image description here enter image description here enter image description here

UPDATE1: Removed 2.2 preview (NOT SOLVED, 2.1 is still missing) enter image description here

Upvotes: 6

Views: 19613

Answers (4)

alexey
alexey

Reputation: 801

In my case solution was: i removed few .NET Core SDK:s from "Add remove programs" and restarted visual studio. Than SDK that i need was in the list

Upvotes: 0

Dmitry Pavlov
Dmitry Pavlov

Reputation: 28320

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

Upvotes: 22

magicandre1981
magicandre1981

Reputation: 28826

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.

Upvotes: 2

Ares
Ares

Reputation: 101

I had this issue as well, this is what I did and it worked for me, It may or may not for you. I uninstalled everything after 2.0. I then went to this link https://www.microsoft.com/net/download and downloaded both the SDK and Run-time downloads for 2.1 then after installing them I restarted my laptop and booted up VS2017. I then went and tried creating a new web app MVC and selected .netcore 2.1 it was there.

However keep in mind .netcore 2.1 is not yet available for every template you have so check web app MVC template first if its there then you have 2.1 it just may not be available for a specific template you might be trying to use it for yet.

Hope this helps

Upvotes: 0

Related Questions