I simply create a default .NET 6.0 WinForms desktop application in Visual Studio 2022. The application will not build. These errors are given:
error NETSDK1127: The targeting pack Microsoft.NETCore.App is not installed.
Please restore and try again.
error NETSDK1127: The targeting pack Microsoft.WindowsDesktop.App.WindowsForms is
not installed. Please restore and try again.
I bring up Visual Studio Installer, look at individual components, and .NET 6.0 is checked.
The application does target .NET 6.0.
I try to rebuild with the package manager console command “dotnet restore” and wait for 1 hour but nothing happens, no errors appear.
How can I get an application to build?