Since this is a hit on google, for anyone else looking, don’t bother with reinstalling modules and such.
Go to your project.target.cs file, usually in the source folder and get the file.
In it, set the DefaultBuildSettings = BuildSettingsVersion.Latest;
instead of V2, V3, V4, V5, etc.
I wasted over a day reinstalling VS 2022, MSVC and playing with a bunch of nonsense.
This will fix it.