Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.NET 6.0 not showing in Visual Studio 2022 (General Release)

I have installed .NET 6.0 SDK and Visual Studio 2022. However, Visual Studio 2022 does not offer the ability to select .NET 6.0.

I know I can edit the project file with the target framework so please don't suggest that. This question is specifically around the Visual Studio 2022 UI.

dotnet sdks

Visual Studio 2022 UI

Edit 1:

.NET 6.0 Runtime has been selected in the Visual Studio Installer for Visual Studio 2022

Visual Studio Installer

Edit 2:

I can create .NET 6.0 projects but cannot seem to target .NET 6.0 in existing projects which were previously .NET 5.0.

New Project

like image 216
Oliver Avatar asked Nov 11 '21 12:11

Oliver


People also ask

Does Visual Studio 2022 include .NET 6?

Build modern apps As well, our new version also has full support for . NET 6 and its unified framework for web, client, and mobile apps for both Windows and Mac developers. And, Visual Studio 2022 includes robust support for the C++ workload with new productivity features, C++20 tooling, and IntelliSense.

What .NET framework comes with Visual Studio 2022?

Visual Studio 2022 supports the following . NET implementations: . NET Framework versions 4.8.

Is it possible to select net 6 in Visual Studio 2022?

Bookmark this question. Show activity on this post. I have installed .NET 6.0 SDK and Visual Studio 2022. However, Visual Studio 2022 does not offer the ability to select .NET 6.0.

Is there a preview version of Microsoft Visual Studio 2022?

However, the preview version is available for testing and research purposes. We will also look at a new feature in the .NET 6 framework which is available along with Visual Studio 2022. So, let us begin. The preview version of Microsoft Visual Studio 2022 is available here.

Which version of Visual Studio has net 6 support?

Visual Studio 2022 comes with a better .NET 6 support, and it is the in Preview/RC stage. NET 6 itself is also available as a preview version. So at the very least, I'd wait for stable versions.

What version of Visual Studio do I need to use design time?

To use the design time in a .NET Core 3.1, .NET 5 or .NET 6 project, use Visual Studio 2019. This limitation applies to .NET 5 and .NET 6 projects only, .NET Framework is fully supported. 11/10/2021: v21.2.3 (the Release build) fully supports Visual Studio 2022 Preview5/6.


Video Answer


4 Answers

If your solution has a gobal.json file, you can either delete it or update the sdk version over there to the latest. At the point of this answer the latest .NET version is 6.0.0 with the sdk version as 6.0.100 (Latest sdk version could be found at the dotnet core site where you downloaded your sdk)

{
    "sdk": {
        "version": "6.0.100"
    }
}

Where to confirm your sdk version from your download

After you have done that, 'Unload' and 'Reload' your project and the latest .Net Core target should show up in the dropdown.

like image 189
Anup Amin Avatar answered Oct 28 '22 06:10

Anup Amin


I wonder if this is the same problem I've been struggling with - you can't change an existing project that is not in the 'sdk' format to net 6. But there is an upgrade assistant that will convert it for you.
See https://learn.microsoft.com/en-us/dotnet/core/porting/upgrade-assistant-winforms-framework

You have to install the upgrade assistant with

dotnet tool install -g upgrade-assistant

After installation, you can either analyze your project

cd "C:\your solution path"
upgrade-assistant analyze yourProject.csproj

or run the upgrade by

cd "C:\your solution path"
upgrade-assistant upgrade yourProject.csproj

The assistant will guide you through the steps.

like image 8
Graham Morris Avatar answered Oct 28 '22 05:10

Graham Morris


During Visual Studio setup, you need to select the ".NET 6.0 Runtime". As can be seen in the screenshot, this option not only includes the runtime itself but also "templates for developing [...] .NET 6.0 applications".

screenshot

You can modify your installation by starting "Apps & Features" from the Windows start menu or by selecting Tools/"Get Tools and Features..." from the Visual Studio menu bar.

like image 6
Heinzi Avatar answered Oct 28 '22 07:10

Heinzi


I have faced this issue when i used upgrade-assistant. it got upgraded to netstandard20. as part of the migration it has created the back up project also. when i open the back up project it was pointing to the net60.

Apart you can open the project file and target to the net6.0. try to unload and reload the project if it is not reflecting immediately.

like image 1
Ajay Kopperla Avatar answered Oct 28 '22 06:10

Ajay Kopperla