Error HRESULT E_FAIL has been returned from a call to a COM component

There are scenarios where you might find the following errors/exceptions:

---------------------------
Setup
---------------------------
Setup encountered an unexpected error in the package contents.The package will not be installed.Please contact your vendor for a new package.
---------------------------
OK  
---------------------------

---------------------------
Microsoft Visual Studio
---------------------------
Error HRESULT E_FAIL has been returned from a call to a COM component.
---------------------------
OK  
---------------------------

Scenario One: The Microsoft Visual Studio 2010 install crashes immediately after launching the Setup.

I ran process explorer tool https://technet.microsoft.com/en-us/sysinternals/bb896645.aspx before launching the VS 2010 setup and I found the below information:

Setup.exe 2436 RegQueryValue HKCR\Wow6432Node\CLSID\{F5078F32-C551-11D3-89B9-0000F81FE221}\InProcServer32\(Default) SUCCESS Type: REG_EXPAND_SZ, Length: 66, Data: %SystemRoot%\System32\msxml3.dll
Setup.exe 2436 RegQueryValue HKCR\Wow6432Node\CLSID\{F5078F32-C551-11D3-89B9-0000F81FE221}\InProcServer32\(Default) SUCCESS Type: REG_EXPAND_SZ, Length: 66, Data: %SystemRoot%\System32\msxml3.dll
Setup.exe 2436 RegQueryValue HKCR\Wow6432Node\CLSID\{F5078F32-C551-11D3-89B9-0000F81FE221}\InProcServer32\(Default) SUCCESS Type: REG_EXPAND_SZ, Length: 66, Data: %SystemRoot%\System32\msxml3.dll

From the above information I found that it was using 64 bit msxml3.dll from a 32 bit registry location( com registration). So registering msxml3.dll appropriately resolved the issue.

Start—>Run—> regsvr32 %SystemRoot%\System32\msxml3.dll

Start—>Run—> regsvr32 %SystemRoot%\SysWOW64\msxml3.dll

 

Scenario Two:

The Microsoft Visual Studio 2010 IDE  crashes while creating OR debugging a web application project.

This above error occurs because of corrupted Cache of Visual Studio 2010. In order to resolve the issue just delete the project Cache from the below location:

C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\ProjectTemplatesCache

C:\Program Files(x86)\Microsoft Visual Studio 10.0\Common7\IDE\ProjectTemplatesCache

Then run "devenv.exe /setup" to re-build the cache.

Start—>Run—> C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe /setup