COM Exception from HRESULT: 0x80080005


"COMException (0x80080005): Retrieving the COM class factory for component with CLSID failed due to the following error: 80080005" - If you faced this error, check out for the possible solution. - Article authored by Kunal Chowdhury on .

While working with Microsoft Office Interoperability, you may face the following exception that states: "COMException (0x80080005): Retrieving the COM class factory for component with CLSID failed due to the following error: 80080005".

 

This issue happens when Outlook is already running and you are trying to access it's mailbox from Visual Studio environment. Let's discuss more about the issue.

 

System.Runtime.InteropServices.COMException (0x80080005): Retrieving the COM class factory for component with CLSID {0006F03A-0000-0000-C000-000000000046} failed due to the following error: 80080005 (www.kunal-chowdhury.com)

 

If you see the following error "System.Runtime.InteropServices.COMException (0x80080005): Retrieving the COM class factory for component with CLSID {0006F03A-0000-0000-C000-000000000046} failed due to the following error: 80080005." while running your Office Interop app from Visual Studio, to read Outlook mailbox, it's nothing to do with the codebase. If you run this as a standalone app, it will work.

 

The possible reason is that the Outlook application is already running. If you close Outlook client and run the same app from Visual Studio, it works fine.

 

This error is caused by Visual Studio being run with admin privileges. If you encounter this error, restart Visual Studio as a normal user mode and run the application. The root cause of this issue is that, Outlook does not allow separate users to access the same mailbox. As Outlook is already running with normal privileges and you are trying to access it again but from Visual Studio with admin privileges, the error happened.

 

 

Have a question? Or, a comment? Let's Discuss it below...

dhgate

Thank you for visiting our website!

We value your engagement and would love to hear your thoughts. Don't forget to leave a comment below to share your feedback, opinions, or questions.

We believe in fostering an interactive and inclusive community, and your comments play a crucial role in creating that environment.