Error running COM - CO_E_SERVER_EXEC_FAILURE - C #

1

I'll start with the error:

  

Retrieving the COM factory class for component with CLSID {1CF0DE77-8CAE-11D1-82A2-0060083F9B01}   failed due to the following error: 80080005 Server execution failed   (Exception from HRESULT: 0x80080005 (CO_E_SERVER_EXEC_FAILURE)).

Sometimes (not always), when I am executing a function that is defined by a COM I get that error and there is no way to solve it.

I have already applied the "rules" in the COM definition:

  • Have Interface
  • Make sure you have defined in the classes:

    [ComVisible(true)]
    [ClassInterface(ClassInterfaceType.None)]
    [Guid("XXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX")] //GUID que se desee
    [ProgId("NombredeCom")]
    [ComDefaultInterface(typeof(IInterfaceDefinida))]
    

Where the GUID is well defined, the IInterfaceDefinida is comvisible and does not give any errors or compilation warning.

But, sometimes, the error that I mentioned for no apparent reason appears. How can it be solved?

    
asked by Miquel Coll 20.07.2016 в 18:17
source

1 answer

0

If, after doing everything indicated in the question, you keep throwing that error, the reason is very simple :

CPU load

After researching a lot I found little pearls (here the first , the second and the third ) in which the issue of CPU load is mentioned in passing.

That is not possible to fix directly since it does not depend on the application itself but you can capture the error:

catch (Exception ex)
    {
        if (ex.Message.Contains("CO_E_SERVER_EXEC_FAILURE"))
        {
            MessageBox.Show("Carga de CPU muy alta. Inténtelo más tarde.");
        }
    }

And at the same time look for why there is a high CPU load.

    
answered by 20.07.2016 / 18:17
source