COM Exception from HRESULT: 0x80080005

COM Exception from HRESULT: 0x80080005


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.

 

 


If you have come this far, it means that you liked what you are reading. Why not reach little more and connect with me directly on Twitter, Facebook, Google+ and LinkedIn. I would love to hear your thoughts and opinions on my articles directly. Also, don't forget to share your views and/or feedback in the comment section below.

0 comments

 
© 2008-2017 Kunal-Chowdhury.com - Microsoft Technology Blog for developers and consumers | Designed by Kunal Chowdhury
Back to top