Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio does not display .NET Core 2.2 in Target Framework dropdown [duplicate]

I just cloned into an already existing project for work, and have found that for some reason, Visual Studio refuses to show .NET Core 2.2 in the "Target Framework" dropdown menu in the Properties -> Application menu.

I have installed .NET Core 2.2 (by clicking "install other frameworks" and downloading/running the 2.2 SDK file. I have originally installed the x64 version as that's what my boss uses, but I later also installed the x84 version to see if that worked. Neither works.), and confirmed that this is correctly installed. I did this by running the command "dotnet --info" in the shell, which outputs the following:

.NET Core SDK (reflecting any global.json):
 Version:   2.2.101
 Commit:    236713b0b7

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.16299
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:\Program Files\dotnet\sdk\2.2.101\

Host (useful for support):
  Version: 2.2.0
  Commit:  1249f08fed

.NET Core SDKs installed:
  1.1.11 [C:\Program Files\dotnet\sdk]
  2.2.101 [C:\Program Files\dotnet\sdk]

.NET Core runtimes installed:
  Microsoft.AspNetCore.All 2.2.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.App 2.2.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 1.0.13 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 1.1.10 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.2.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]

Still, there are no .NET Core 2.2 in the Target Framework dropdown. There are only two options currently: .NETCoreApp 1.0 and .NETCoreApp 1.1

I've got Visual Studio 2017, and as far as I can tell from the About page, version 15.0.0

like image 429
TheJack38 Avatar asked Jan 08 '19 09:01

TheJack38


3 Answers

I was having the same issue after downloading the latest dotnet-SDK-2.2.202 (at the moment). Tried everything on this thread and nothing worked.

I also recently updated to the latest VStudio 2017 - 15.9.11

Then I downloaded and installed the previous dotnet-SDK-2.2.105 available and it fixed the issue.

Find it here: https://dotnet.microsoft.com/download/dotnet-core/2.2

like image 137
Javier Alvarez Avatar answered Nov 19 '22 20:11

Javier Alvarez


.net core SDK 2.2.202 requires MS build 16 to work. So you would need to install Visual Studio 2019.

See 2.2.202-SDK not available in Visual Studio 2017 #2542

like image 42
Alex Nazarevych Avatar answered Nov 19 '22 22:11

Alex Nazarevych


Your Visual Studio Version is not up to date. You need to update it.

Visual Studio 2017 15.9 uses .NET Core 2.1 SDK by default after the workload is installed.

To update Visual Studio to use .NET Core 2.2 SDK:

Install the .NET Core 2.2 SDK.

Reference

PS: You need to restart visual studio. After you the installation of .Net Core 2.2 SDK.

like image 11
Derviş Kayımbaşıoğlu Avatar answered Nov 19 '22 20:11

Derviş Kayımbaşıoğlu