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

Community
  • 1
  • 1
Ken
  • 101
  • 3
  • 7
  • Is your COM server 32-bit? Are you running the 64-bit .NET CLR? – Rup May 18 '11 at 13:31
  • 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 May 18 '11 at 14:06
  • 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 May 20 '11 at 14:24
  • 2
    smells like security problems to me.. are you running with elevated priviliges or are you just logged into windows as administrator? – aL3891 Jul 20 '11 at 14:36

2 Answers2

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

Bryan Legend
  • 6,790
  • 1
  • 59
  • 60
-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

Dinesh Haraveer
  • 1,784
  • 3
  • 31
  • 54
  • 1
    The question has nothing to do with Office. – Bryan Legend Jun 04 '15 at 20:01
  • @BryanLegend He was thinking it was about this: https://stackoverflow.com/questions/3477086/accessing-office-word-object-model-through-asp-net-results-in-failed-due-to-the But you're totally right. – vapcguy Nov 09 '18 at 01:39