Error HRESULT E_FAIL has been returned from a call to a COM component VS2012 when debugging
I had the same problem with a c++ project in Visual Studio 2019. The following solution worked for me: Close Visual Studio. Go to the project’s root folder and delete the .vs directory. Start Visual Studio and open the solution. The build should now work.