Visual Studio reports Error HRESULT E_FAIL has been returned from a call to a COM component when viewing a Windows Form

You may see an issue whereby Visual Studio reports the following when viewing a Windows Form

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



There are a number of fixes on the internet however none of them resolved the issue.

On inspecting the designer.cs files for the affected forms we found errors stating that types from the projected conflicted with types imported from... the project...

This seemed strange however found found that Visual Studio had in fact added a reference to the binary created by the project into the project without our doing anything.

The Visual Studio WinForms designers are notoriously problematic with unpredictable things like this happening.

Having removed the reference the problems went away.



 While you're here -
Why not check out our 
Active Directory Documentation Tool?



Comments

Popular posts from this blog

Windows Server 2016, 2019, 2022, Windows 10 and Windows 11: Date and time "Some settings are managed by your organization".

TFTPD32 or TFTPD64 reports Bind error 10013 An attempt was made to access a socket in a way forbidden by its access permissions.

Windows Server 2019 desktop icons such as My Computer, Windows cannot access the specified device, path, or file.