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.
Edit 1:
.NET 6.0 Runtime has been selected in the Visual Studio Installer for Visual Studio 2022
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.
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.
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".
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.
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://docs.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.