.net interface to COM server fails with 0x80080005

6

I have a native c++ COM server that exposes COM interfaces. I can successfully use a native c++ client application to get and use the exposed interfaces from the server.

When I use a .net client with a reference to the server, I get the error:

Retrieving the COM class factory for component with CLSID {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx} failed due to the following error: 80080005 Server execution failed (Exception from HRESULT: 0x80080005 (CO_E_SERVER_EXEC_FAILURE)).

...even though the COM server starts and runs successfully (and only takes about 1 or 2 seconds to startup).

BUT I get the above error only when the server is registered as a local server. If I register the server as a windows service, the .net client can successfully get and use the interfaces just fine.

I'm doing all this as an admin on Windows 7 64-bit. The COM server is on the local machine.

I checked the thread below, but no answers were offered: Retrieving the COM class factory for component with CLSID {XXXX} failed due to the following error: 80080005

Spent a day and a half on this one so far...what could be the problem?

More information:
I've had this working with vs2005. I recently updated to vs2010 and am now running into this issue. I've tried building the .net client targeting frameworks 2.0, 3.5, and 4.0 with the same results.

Thanks

.net
com
interop
asked on Stack Overflow May 18, 2011 by Ken • edited May 23, 2017 by Community

2 Answers

0

I was seeing this error when using a .net app running on x64 to try to connect to a 32 bit COM app. I was able to fix it easily by switching my .net app to x86 (32 bit).

answered on Stack Overflow Aug 26, 2015 by Bryan Legend
-2

Microsoft does not currently recommend, and does not support, Automation of Microsoft Office applications from any unattended, non-interactive client application or component (including ASP, ASP.NET, DCOM, and NT Services), because Office may exhibit unstable behavior and/or deadlock when Office is run in this environment.

For More information check this Link

answered on Stack Overflow Mar 13, 2013 by Dinesh Haraveer

User contributions licensed under CC BY-SA 3.0