.net for COM server with error 0x80080005

I have my own C ++ COM server that provides COM interfaces. I can successfully use my own C ++ client application to receive and use open interfaces from the server.

When I use the .net client with a link to the server, I get an error message:

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

... even though the COM server starts and starts successfully (and it only takes 1 or 2 seconds to start).

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 do all this as an administrator on Windows 7 64-bit. The COM server is located on the local machine.

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

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

Additional Information:
I worked with vs2005. I recently upgraded to vs2010, and now I am facing this problem. I tried to create .net 2.0, 3.5, and 4.0 client targeting platforms with the same results.

thanks

+6
source share
2 answers

I saw this error when using an .net application running on x64 to try to connect to a 32-bit COM application. I could fix this easily by switching my .net application to x86 (32 bit).

0
source

Microsoft does not currently recommend or support the automation of Microsoft Office applications from any inactivity, 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 running in this environment.

See link for more details.

-2
source

Source: https://habr.com/ru/post/888416/


All Articles