I am using VS 2022 - 17.4.1
These are the installed components
And options
My Windows version is 10.0.22621
When I was trying to fix the issue I noticed, that my .NET was installed in C:\programs\dotnet and i still had an old sdk version in C:\programs (x86)\dotnet.
I then copied the newer sdk over.
Maybe that will fix the problem for you aswell.