I recently has this issue and none of the reccommended solutions worked for me. What did end up working was installing all available updates to both Visual Studio 2019 (the version I am actually using for this project) and for Visual Studio 2022 (which I also have installed for other projects). Once both versions were up to date, the build started working in Visual Studio 2019 again.