16
votes

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

6

6 Answers

11
votes

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.

46
votes

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

15
votes

.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

9
votes

I had the same issue, and the Core 2.2 did not show up on the Visual Studio in the Target platforms dropdown. I did everything answered above and still had the same issue. Finally I ended up creating a new global json config using

dotnet new globaljson --sdk-version 2.2.101 --force

Restarting Visual Studio after the above step worked for me.

0
votes

Check to see if there is a global.json file in the same folder as your solution file. I removed it and everything is working again.

-1
votes

I was having the same problem in my VS 2017 -version 15.8 I tried by update the vs2017 to the latest version 15.9.11 and installed the latest .net core 2.2.203 SDK, but still not getting the desired target framework 2.2

When I installed the .net core 2.2.105 SDK and after restarting the VS, I got the target framework 2.2