For anyone else who also encountered this problem, my problem was because my .NET 6.0 Runtime isn’t installed properly, so what I did is:
-
Open Visual Studio Installer, and select modify (I’m using Visual studio 2022)
-
Proceed to the Workloads tab, remove all the check marks shown in the tutorial picture here
-
and after removing everything, go to your system’s settings’ programs and features, and check if there are some remaining .NET stuff, take a picture(just incase you need to reinstall some of the other ones), and delete all of it
-
finally go back to the Workloads tab and tick those on again, and wait for it to reinstall, and voila! you should be able to create / build C++ projects again!
Hope this will help anyone in confusion!