Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.NET Core 2.2 Can't be Selected In Visual Studio Build Framework

Previously, I was able to select the .NET Core 2.2 Framework in the properties section of the .NET Core project, but after the latest visual studio updates I haven't been able to.

Framework Selection

Things I've tried:

  • Repairing the .NET Core 2.2 SDK installation
  • Uninstalling and Reinstalling the .NET Core 2.2 SDK
  • Restarting Visual Studio
  • Restarting my machine
  • Making a fresh .NET Core project

Nothing has been able to work. From the fact that it was working before I installed the latest updates, could it just be a bug? Or is there something that I'm missing?

For some more clarity, I'm running in Windows 10 Professional x64 on the latest version of windows.

I installed this version of .NET Core 2.2 from here

enter image description here

Any help is appreciated. Thanks!

like image 279
Memedon Avatar asked Nov 15 '18 23:11

Memedon


People also ask

What version of NET Core is available in Visual Studio 2017?

.NET Core 2.2 is not available as a "Target framework" in Visual Studio 2017 (15.9.11) after installing the 2.2.202-SDK (x86/x64). After installing the 2.2.101-SDK, however, "Target framework" correctly displays ".NET Core 2.2" as an option. The 2.2.2xx train only works with VS 2019 (same as 2.1.6xx only works in VS 2019 and 2.1.5xx in VS 2017).

How do I install Visual Studio workloads with NET Core?

Visual Studio Workloads with.NET Core The installer Workloads selection has the same experience as previous versions of Visual Studio. When a workload is selected which requires.NET Core, the 3.0 Development Tools (SDK) and 3.0 Runtime will be installed. Adding.NET Core 2.1 or 2.2

What if I have already installed the net core SDK?

If you have already installed the .NET Core 2.1 and/or 2.2 SDK, no additional actions are needed for applications to target these versions. Even though you may have .NET Core 2.1 or 2.2 installed, the Visual Studio Installer Individual Components tab will not have these components selected.

Can Visual Studio 2017 and Visual Studio 2019 be installed together?

However, Visual Studio 2017 requires 2.2.1nn (such as 2.2.106). . NET Core SDK 2.2.2nn works with Visual Studio 2019. Visual Studio 2017 and Visual Studio 2019 can be installed side by side, but this requires both .NET Core SDK 2.2.1nn and .NET Core SDK 2.2.2nn to develop .NET Core 2.2 applications.


3 Answers

I have same problem. I am trying fix this issue about one day. Finally I figuret out. My VS version is 15.9.11 and Community Edition.

Issue details: 2.1.6xx & 2.2.2xx version of the sdks are only supported on Visual Studio 2019. VS 2017 needs 2.1.5xx & 2.2.1xx versions of the sdk.

How to fix the issue? Install 2.1.5xx version of the SDK if you are targetting a 2.1 app Install 2.2.1xx version of the SDK if you are targetting a 2.2 app.

The link is here

Edit: The direct link to downloadable installers is https://dotnet.microsoft.com/download/dotnet-core/2.2. As noted above, do check which SDK version is compatible with Visual Studio 2019 and/or Visual Studio 2017.

For example, if you want to use .NET version 2.2.7 in Visual Studio 2017 (v15.9), the only SDK version that works is SDK 2.2.109. To use SDK 2.2.206 you must have Visual Studio 2019 (v16.0). To use SDK 2.2.402 you must have Visual Studio 2019 (v16.2).

like image 174
Bahadır EKİCİ Avatar answered Oct 11 '22 14:10

Bahadır EKİCİ


Configure Visual Studio 2017 15.9 to use the previews of .NET Core SDK (in Options) and restart VS.

Update in 2019:

Microsoft decides that VS2017/2019 should use different .NET Core SDK versions, so make sure you do install the correct versions for your VS versions, and read the official announcement here,

https://github.com/dotnet/announcements/issues/108

You might find the SDK version/VS version table in .NET Core release notes, such as https://github.com/dotnet/core/blob/master/release-notes/2.2/2.2.4/2.2.4.md

Is a good practice to subscribe to the Microsoft .NET and Visual Studio team blogs so that you can always learn the new things, like https://blogs.msdn.microsoft.com/dotnet/2018/11/13/net-core-tooling-update-for-visual-studio-2017-version-15-9/

like image 39
Lex Li Avatar answered Oct 11 '22 15:10

Lex Li


Visual Studio 2017 and 2019 require specific build versions. Missing these will give this error.

  • 2017 uses x.x.100
  • 2019 uses x.x.200

Latest sdk https://github.com/dotnet/core specific to each vs version.

https://github.com/dotnet/core/blob/master/release-notes/2.2/2.2.4/2.2.4-download.md

  • 2017 install 2.2.106
  • 2019 install 2.2.203

This resolved the issue

like image 35
Donald Webb Avatar answered Oct 11 '22 16:10

Donald Webb