6
votes

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

2
Is your COM server 32-bit? Are you running the 64-bit .NET CLR? - Rup
The COM server is 32-bit. I've built the .net client specifically for x86...is there anything else needed to target 32-bit CLR? - Ken
Could this be related to single vs multiple instances of the server? When registered as a service, everything works. Clients can connect to the server and do their work. When registered as a local server, a new instance of the server is started by each attempted client connection and then the 0x80080005 error happens; so after several tests I have several instances of the server running instead of just one. - Ken
smells like security problems to me.. are you running with elevated priviliges or are you just logged into windows as administrator? - aL3891

2 Answers

0
votes

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).

-2
votes

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