I got this error after a Windows update because I was using an outdated version of Visual Studio 2022. Updating Visual Studio fixed this for me.